SlideShare a Scribd company logo
1 of 5
Explain the concept of Foreign Key. How a foreign key differs from a Primary Key? Can the Foreign Key accept
nulls?
Answer
Foreign Key:
A foreign key is a column in a table where that column is primary key of another table, which means that any
data in a foreign key column must have corresponding data in the other table where that column is the primary
key. Whereas primary key is a column or set of columns that uniquely identifies the rest of the data in any given
row.
For e.g consider a Table:
Students ID
number
Student
name
Subject enrolled In
Year of
course
1245 Sanjay Mathematics 3
1246 Vijay Science 4
1247 Jameel Political science 3
1248 Nitesh Arts 3
In the above table “Student ID number” is the primary key as this uniquely identifies that row. This means no
two rows can have the same “Student ID number” and is two students have the same name then “Student ID
number” ensures that those two students are not same.
Therefore if this “Student ID number” is used as a primary key for some other table then this ID is the foreign
key. No component of the primary key can be null whereas in the case of foreign key there is no integrity rule
saying that no component of the foreign key can be null. Therefore foreign key accepts null.
With a necessary example explain (i) Basic Constructs of E-R Modeling (ii) E-R Notations.
Answer
Entity name
Entity Relationship name
One Many
vlanages
Relationship
Attribute name
Mandatory existence Optional existence
ER NOTATION
Department
DepID
Project
ProjectID
Constructs of E-R Modeling: ER modeling views the real worlds as a constructs of entities and association
between entities.
Entities: Entities are the principal data object about which information is to be collected. It is classified as
independent or dependent. An independent entity is one that does not rely on another for identification
whereas dependent is one that relies on another for identification. Special entity types are associative, and
subtype entities.
Relationship: a relationship represents as association between two or more entities. Relationships are classified
in terms of degree, connectivity, cardinality and existence.
Attributes: Attributes describes the entity of which they are associated. Attributes can be classified as
identifiers or descriptors. Identifiers, or keys, uniquely identify an instance of an entity. A descriptor describes a
non-unique characteristic of an entity instance.
Degree of relationship: It is the number of entities associated with the relationship
Connectivity and cardinality: It describes the mapping of associated entity instance in a relationship. The value
of connectivity are one-to-one (1: 1), one-to-many (1 : N), Many-to-Many (M : N).
Direction: Direction of a relationship indicates the originating entity of a binary relationship the entity from
which a relationship originates is the parent entity and entity where relationship terminates is the child entity.
Existence: Existence denotes whether the existence of an entity instance is dependent upon the existence of
another, related, entity instance.
ER Notations: Basic ER notations are as:
1) Entities are represented by labeled rectangles.
2) Relationships are represented by a solid line connecting two entities.
3) Attributes when included are listed inside the entity rectangle. Attributes which are identifiers are
underlined
4) Cardinality of many is represented by a line ending in a crow’s foot. If the crow’s foot is omitted, the
cardinality is one.
5) Existence is represented by placing a circle or a perpendicular bar on the line.
Explain the first 3 Normal Forms taking the help of an un-normalized relation and reducing it to 3 NF.
Answer
Normalization is the process of efficiently organizing data in a database.
First Normal Form (1NF): A relation which contains a repeating group is called an un-normalized relation.
Therefore a relation is said to be in first normal form if it does not contain repeating groups.
Second Normal Form (2NF): A relation is said to be in 2NF if it is in 1NF and no non-key attribute is functionally
dependent on only a portion of the primary key. For example consider a table Software.
Software
packid packname tagnumber cost cmpid
MST microsoft 11382 500 M223
DBS Database 11256 400 S456
FP1 IBM 11695 900 D765
FP1 IBM 11584 700 S098
As we can see that in the column packid FP1 occurs several times. This causes several problems like wastage of
memory and update, inconsistent data addition and deletions problems. Therefore a relation is said to be in
2NF if it is in 1NF and contains no partial dependencies, so software table is currently is not in 2NF, Method to
convert it into 2NF is as follows.
For each subset of the set of attributes , which make up the primary key start a relation with this subset as its
primary key so for software relation , now place the other attributes in such a way that we obtain minimal
relation for which these subsets of attributes are primary key, so we obtain
(packid, packname)
(tagnumber,cmpid)
(packid,tagnumber,cost)
So each of above relation can now be given a name which is descriptive of the meaning of the relation e.g.
PACK, COMP, SOFT.
Third Normal Form (3NF): A relation is said to be in 3NF if it is in 2NF and if the only determinants it has are
candidate keys. Where an attribute which determines another attribute is called determinant.
Explain the concept of Data Mining? How it is related with data warehouse.
Answer
Data mining: Data mining is basically used to discover new rules and patterns from the supplied data. It is also
said that it addresses inductive knowledge. Following are the five knowledge discovered during data mining
Association rule: these rules correlate the presence of a set of items with another range of values for another
set of variables.
Classification hierarchies: the goal is to work from an existing set of events or transactions to create a hierarchy
of classes.
Sequential patterns: A sequence of actions or events is sought.
Patterns with time series: Similarities can be detected within position of time series of data, which is a sequence
of data taken at regular interval such as daily sales or daily closing stock prices.
Clustering: A given population of events can be partitioned into set of similar elements.
As data mining concept can be applied to large variety of decision making contexts in business, some particular
areas are Marketing, Finance, Manufacturing, Health care
Further Data mining is related with data warehouse as follows:
As goal of data warehouse is to support decision making with data. Data mining can be used in conjunction with
a data warehouse to help with certain types of decisions. Data mining can be applied to operational databases
with individual transactions. To make data mining more efficient, the data warehouse should have an
aggregated or summarized collection of data. Data mining helps in extracting meaningful new patterns that
cannot be found by merely querying or processing data in the data warehouse. Data mining application should
therefore be strongly considered early, during the design of the data warehouse. Also data mining tools should
be designed to facilitate their use in conjunction with data warehouse. In fact for very large databases running
into terabytes of data, successful use of data mining applications will depend first on the construction of a data
warehouse.
Therefore data warehouse provides access to data for complex analysis, knowledge discovery and decision
making and they support high-performance on an organization’s data and information whereas data mining is
used to discover new rules and patterns from the supplied data.
Write the SQL queries using Data Manipulation Language (DML) statements.
(a) Insert values into student table with field names using insert command
(b) Display the table student using select command
(c) Update student address in student table using update command.
(d) Delete a row from student table.
Answer
Creating a Table:
CREATE TABLE STUDENT
(
Student INT,
First name VARCHAR (20),
Last name VARCHAR (20),
Gender ENUM (‘M’,’F’),
Address VARCHAR (100)
)
(a) Insert values into student table with field names using insert command
INSERT INTO STUDENT(StudentID,Firstname,Lastname,Gender,Address)VALUES(234,nikhil,singh,M,H-12 Delhi);
(b) Display the table student using select command
SELECT StudentID,Firstname,Lastname,Gender,Address FROM STUDENT;
(c) Update student address in student table using update command
UPDATE STUDENT address = H-29 new Delhi WHERE ITEM = ‘H-12 Delhi’;
(d) Delete a row from student table
DELETE FROM STUDENT WHERE studentID=’234’ AND first name = Nikhil AND last name = Singh ;
Create the payroll database considering table employee.
(a) Do simple queries on the above database.
i. List all information of the above both tables.
ii. List the empno, ename, jobtitle,and hiredate of employee from the employee table.
(b) List the name, salary of the employees who are clerks.
(c) List the name,job,salary of every employee joined on certain date. (say ‘december 17,1980’)
(d) List name and annual salary of all the employees.
(e) List the employees who have salary between certain range (say between Rs. 1000 & 2000)
Answer
CREATE TABLE employee
(
emp_no INT
ename VARCHAR(20)
job title VARCHAR(16)
salary INT
hiredate DATE
);
(a) (1) List all information of the above both tables.
SELECT * FROM employee;
(2) List the empno, ename, jobtitle,and hiredate of employee from the employee table
SELECT empno, ename, jobtitle, hiredate FROM employee;
(b) List the name, salary of the employees who are clerks
SELECT ename, salary FROM employee WHERE job title = ‘clerks’;
(c) List the name,job,salary of every employee joined on certain date. (say ‘december 17,1980’)
SELECT ename, job title, salary FROM employee WHERE hiredate = ‘december 17,1980’;
(d) List name and annual salary of all the employees.
SELECT ename, SUM(salary) FROM employee GROUP BY ename;
(e) List the employees who have salary between certain range (say between Rs. 1000 & 2000)
SELECT ename FROM employee WHERE salary BETWEEN 1000 AND 2000;

More Related Content

What's hot

Fundamentals of database system - Relational data model and relational datab...
Fundamentals of database system  - Relational data model and relational datab...Fundamentals of database system  - Relational data model and relational datab...
Fundamentals of database system - Relational data model and relational datab...Mustafa Kamel Mohammadi
 
Database Assignment
Database AssignmentDatabase Assignment
Database AssignmentJayed Imran
 
5. Other Relational Languages in DBMS
5. Other Relational Languages in DBMS5. Other Relational Languages in DBMS
5. Other Relational Languages in DBMSkoolkampus
 
Chapter3 the relational data model and the relation database constraints part2
Chapter3 the relational data model and the relation database constraints part2Chapter3 the relational data model and the relation database constraints part2
Chapter3 the relational data model and the relation database constraints part2eidah20
 
CIS 336 Wonderful Education--cis336.com
CIS 336 Wonderful Education--cis336.comCIS 336 Wonderful Education--cis336.com
CIS 336 Wonderful Education--cis336.comJaseetha16
 
Relational database intro for marketers
Relational database intro for marketersRelational database intro for marketers
Relational database intro for marketersSteve Finlay
 
Efficiency of TreeMatch Algorithm in XML Tree Pattern Matching
Efficiency of TreeMatch Algorithm in XML Tree Pattern  MatchingEfficiency of TreeMatch Algorithm in XML Tree Pattern  Matching
Efficiency of TreeMatch Algorithm in XML Tree Pattern MatchingIOSR Journals
 
The relational data model part[1]
The relational data model part[1]The relational data model part[1]
The relational data model part[1]Bashir Rezaie
 
Database : Relational Data Model
Database : Relational Data ModelDatabase : Relational Data Model
Database : Relational Data ModelSmriti Jain
 
Islamic University Previous Year Question Solution 2019 (ADBMS)
Islamic University Previous Year Question Solution 2019 (ADBMS)Islamic University Previous Year Question Solution 2019 (ADBMS)
Islamic University Previous Year Question Solution 2019 (ADBMS)Rakibul Hasan Pranto
 

What's hot (20)

The Relational Model
The Relational ModelThe Relational Model
The Relational Model
 
Deductive Database
Deductive DatabaseDeductive Database
Deductive Database
 
Relational model
Relational modelRelational model
Relational model
 
Deductive databases
Deductive databasesDeductive databases
Deductive databases
 
Relational model
Relational modelRelational model
Relational model
 
Dbms
DbmsDbms
Dbms
 
Sec 2 1st term rev.
Sec 2  1st term rev.Sec 2  1st term rev.
Sec 2 1st term rev.
 
Denormalization
DenormalizationDenormalization
Denormalization
 
Fundamentals of database system - Relational data model and relational datab...
Fundamentals of database system  - Relational data model and relational datab...Fundamentals of database system  - Relational data model and relational datab...
Fundamentals of database system - Relational data model and relational datab...
 
Database Assignment
Database AssignmentDatabase Assignment
Database Assignment
 
5. Other Relational Languages in DBMS
5. Other Relational Languages in DBMS5. Other Relational Languages in DBMS
5. Other Relational Languages in DBMS
 
Chapter3 the relational data model and the relation database constraints part2
Chapter3 the relational data model and the relation database constraints part2Chapter3 the relational data model and the relation database constraints part2
Chapter3 the relational data model and the relation database constraints part2
 
Computer sec2-1st term
Computer sec2-1st termComputer sec2-1st term
Computer sec2-1st term
 
CIS 336 Wonderful Education--cis336.com
CIS 336 Wonderful Education--cis336.comCIS 336 Wonderful Education--cis336.com
CIS 336 Wonderful Education--cis336.com
 
Relational database intro for marketers
Relational database intro for marketersRelational database intro for marketers
Relational database intro for marketers
 
Efficiency of TreeMatch Algorithm in XML Tree Pattern Matching
Efficiency of TreeMatch Algorithm in XML Tree Pattern  MatchingEfficiency of TreeMatch Algorithm in XML Tree Pattern  Matching
Efficiency of TreeMatch Algorithm in XML Tree Pattern Matching
 
The relational data model part[1]
The relational data model part[1]The relational data model part[1]
The relational data model part[1]
 
Presentation
PresentationPresentation
Presentation
 
Database : Relational Data Model
Database : Relational Data ModelDatabase : Relational Data Model
Database : Relational Data Model
 
Islamic University Previous Year Question Solution 2019 (ADBMS)
Islamic University Previous Year Question Solution 2019 (ADBMS)Islamic University Previous Year Question Solution 2019 (ADBMS)
Islamic University Previous Year Question Solution 2019 (ADBMS)
 

Similar to Bc0041

COMPUTERS Database
COMPUTERS Database COMPUTERS Database
COMPUTERS Database Rc Os
 
2. Introduction to Data Structure.pdf
2. Introduction to Data Structure.pdf2. Introduction to Data Structure.pdf
2. Introduction to Data Structure.pdfSulabhPawaia
 
Bca examination 2017 dbms
Bca examination 2017 dbmsBca examination 2017 dbms
Bca examination 2017 dbmsAnjaan Gajendra
 
DATA STRUCTURES - SHORT NOTES
DATA STRUCTURES - SHORT NOTESDATA STRUCTURES - SHORT NOTES
DATA STRUCTURES - SHORT NOTESsuthi
 
WEKA:Data Mining Input Concepts Instances And Attributes
WEKA:Data Mining Input Concepts Instances And AttributesWEKA:Data Mining Input Concepts Instances And Attributes
WEKA:Data Mining Input Concepts Instances And Attributesweka Content
 
WEKA: Data Mining Input Concepts Instances And Attributes
WEKA: Data Mining Input Concepts Instances And AttributesWEKA: Data Mining Input Concepts Instances And Attributes
WEKA: Data Mining Input Concepts Instances And AttributesDataminingTools Inc
 
Data_Structure_and_Algorithms_Using_C++ _ Nho Vĩnh Share.pdf
Data_Structure_and_Algorithms_Using_C++ _ Nho Vĩnh Share.pdfData_Structure_and_Algorithms_Using_C++ _ Nho Vĩnh Share.pdf
Data_Structure_and_Algorithms_Using_C++ _ Nho Vĩnh Share.pdfNho Vĩnh
 
Introduction to Data Structure
Introduction to Data StructureIntroduction to Data Structure
Introduction to Data StructureJazz Jinia Bhowmik
 
1- Introduction.pptx.pdf
1- Introduction.pptx.pdf1- Introduction.pptx.pdf
1- Introduction.pptx.pdfgm6523
 
Excel analysis assignment this is an independent assignment me
Excel analysis assignment this is an independent assignment meExcel analysis assignment this is an independent assignment me
Excel analysis assignment this is an independent assignment mejoney4
 
Application for Logical Expression Processing
Application for Logical Expression Processing Application for Logical Expression Processing
Application for Logical Expression Processing csandit
 
Data resource management
Data resource managementData resource management
Data resource managementNirajan Silwal
 
Dbms relational model
Dbms relational modelDbms relational model
Dbms relational modelChirag vasava
 

Similar to Bc0041 (20)

Chapter 1
Chapter 1Chapter 1
Chapter 1
 
COMPUTERS Database
COMPUTERS Database COMPUTERS Database
COMPUTERS Database
 
2. Introduction to Data Structure.pdf
2. Introduction to Data Structure.pdf2. Introduction to Data Structure.pdf
2. Introduction to Data Structure.pdf
 
Dsa unit 1
Dsa unit 1Dsa unit 1
Dsa unit 1
 
DBMS (1).pptx
DBMS (1).pptxDBMS (1).pptx
DBMS (1).pptx
 
Bca examination 2017 dbms
Bca examination 2017 dbmsBca examination 2017 dbms
Bca examination 2017 dbms
 
NMEC RD_UNIT 1.ppt
NMEC RD_UNIT 1.pptNMEC RD_UNIT 1.ppt
NMEC RD_UNIT 1.ppt
 
DATA STRUCTURES - SHORT NOTES
DATA STRUCTURES - SHORT NOTESDATA STRUCTURES - SHORT NOTES
DATA STRUCTURES - SHORT NOTES
 
WEKA:Data Mining Input Concepts Instances And Attributes
WEKA:Data Mining Input Concepts Instances And AttributesWEKA:Data Mining Input Concepts Instances And Attributes
WEKA:Data Mining Input Concepts Instances And Attributes
 
WEKA: Data Mining Input Concepts Instances And Attributes
WEKA: Data Mining Input Concepts Instances And AttributesWEKA: Data Mining Input Concepts Instances And Attributes
WEKA: Data Mining Input Concepts Instances And Attributes
 
Data_Structure_and_Algorithms_Using_C++ _ Nho Vĩnh Share.pdf
Data_Structure_and_Algorithms_Using_C++ _ Nho Vĩnh Share.pdfData_Structure_and_Algorithms_Using_C++ _ Nho Vĩnh Share.pdf
Data_Structure_and_Algorithms_Using_C++ _ Nho Vĩnh Share.pdf
 
104333 sri vidhya eng notes
104333 sri vidhya eng notes104333 sri vidhya eng notes
104333 sri vidhya eng notes
 
Introduction to Data Structure
Introduction to Data StructureIntroduction to Data Structure
Introduction to Data Structure
 
1- Introduction.pptx.pdf
1- Introduction.pptx.pdf1- Introduction.pptx.pdf
1- Introduction.pptx.pdf
 
D B M S Animate
D B M S AnimateD B M S Animate
D B M S Animate
 
Excel analysis assignment this is an independent assignment me
Excel analysis assignment this is an independent assignment meExcel analysis assignment this is an independent assignment me
Excel analysis assignment this is an independent assignment me
 
UNIT II DBMS.pptx
UNIT II DBMS.pptxUNIT II DBMS.pptx
UNIT II DBMS.pptx
 
Application for Logical Expression Processing
Application for Logical Expression Processing Application for Logical Expression Processing
Application for Logical Expression Processing
 
Data resource management
Data resource managementData resource management
Data resource management
 
Dbms relational model
Dbms relational modelDbms relational model
Dbms relational model
 

Recently uploaded

Unleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapUnleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapRishantSharmaFr
 
Generative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTGenerative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTbhaskargani46
 
Hostel management system project report..pdf
Hostel management system project report..pdfHostel management system project report..pdf
Hostel management system project report..pdfKamal Acharya
 
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments""Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"mphochane1998
 
Online food ordering system project report.pdf
Online food ordering system project report.pdfOnline food ordering system project report.pdf
Online food ordering system project report.pdfKamal Acharya
 
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdfAldoGarca30
 
Block diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.pptBlock diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.pptNANDHAKUMARA10
 
Work-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptxWork-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptxJuliansyahHarahap1
 
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKARHAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKARKOUSTAV SARKAR
 
DC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equationDC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equationBhangaleSonal
 
Thermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VThermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VDineshKumar4165
 
Introduction to Serverless with AWS Lambda
Introduction to Serverless with AWS LambdaIntroduction to Serverless with AWS Lambda
Introduction to Serverless with AWS LambdaOmar Fathy
 
AIRCANVAS[1].pdf mini project for btech students
AIRCANVAS[1].pdf mini project for btech studentsAIRCANVAS[1].pdf mini project for btech students
AIRCANVAS[1].pdf mini project for btech studentsvanyagupta248
 
Wadi Rum luxhotel lodge Analysis case study.pptx
Wadi Rum luxhotel lodge Analysis case study.pptxWadi Rum luxhotel lodge Analysis case study.pptx
Wadi Rum luxhotel lodge Analysis case study.pptxNadaHaitham1
 
Hospital management system project report.pdf
Hospital management system project report.pdfHospital management system project report.pdf
Hospital management system project report.pdfKamal Acharya
 
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...Amil baba
 
Computer Networks Basics of Network Devices
Computer Networks  Basics of Network DevicesComputer Networks  Basics of Network Devices
Computer Networks Basics of Network DevicesChandrakantDivate1
 
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best ServiceTamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Servicemeghakumariji156
 
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills KuwaitKuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwaitjaanualu31
 

Recently uploaded (20)

Unleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapUnleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leap
 
Generative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTGenerative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPT
 
Integrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - NeometrixIntegrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - Neometrix
 
Hostel management system project report..pdf
Hostel management system project report..pdfHostel management system project report..pdf
Hostel management system project report..pdf
 
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments""Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
 
Online food ordering system project report.pdf
Online food ordering system project report.pdfOnline food ordering system project report.pdf
Online food ordering system project report.pdf
 
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
 
Block diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.pptBlock diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.ppt
 
Work-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptxWork-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptx
 
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKARHAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
 
DC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equationDC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equation
 
Thermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VThermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - V
 
Introduction to Serverless with AWS Lambda
Introduction to Serverless with AWS LambdaIntroduction to Serverless with AWS Lambda
Introduction to Serverless with AWS Lambda
 
AIRCANVAS[1].pdf mini project for btech students
AIRCANVAS[1].pdf mini project for btech studentsAIRCANVAS[1].pdf mini project for btech students
AIRCANVAS[1].pdf mini project for btech students
 
Wadi Rum luxhotel lodge Analysis case study.pptx
Wadi Rum luxhotel lodge Analysis case study.pptxWadi Rum luxhotel lodge Analysis case study.pptx
Wadi Rum luxhotel lodge Analysis case study.pptx
 
Hospital management system project report.pdf
Hospital management system project report.pdfHospital management system project report.pdf
Hospital management system project report.pdf
 
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...
 
Computer Networks Basics of Network Devices
Computer Networks  Basics of Network DevicesComputer Networks  Basics of Network Devices
Computer Networks Basics of Network Devices
 
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best ServiceTamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
 
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills KuwaitKuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
 

Bc0041

  • 1. Explain the concept of Foreign Key. How a foreign key differs from a Primary Key? Can the Foreign Key accept nulls? Answer Foreign Key: A foreign key is a column in a table where that column is primary key of another table, which means that any data in a foreign key column must have corresponding data in the other table where that column is the primary key. Whereas primary key is a column or set of columns that uniquely identifies the rest of the data in any given row. For e.g consider a Table: Students ID number Student name Subject enrolled In Year of course 1245 Sanjay Mathematics 3 1246 Vijay Science 4 1247 Jameel Political science 3 1248 Nitesh Arts 3 In the above table “Student ID number” is the primary key as this uniquely identifies that row. This means no two rows can have the same “Student ID number” and is two students have the same name then “Student ID number” ensures that those two students are not same. Therefore if this “Student ID number” is used as a primary key for some other table then this ID is the foreign key. No component of the primary key can be null whereas in the case of foreign key there is no integrity rule saying that no component of the foreign key can be null. Therefore foreign key accepts null. With a necessary example explain (i) Basic Constructs of E-R Modeling (ii) E-R Notations. Answer Entity name Entity Relationship name One Many vlanages Relationship Attribute name Mandatory existence Optional existence ER NOTATION Department DepID Project ProjectID
  • 2. Constructs of E-R Modeling: ER modeling views the real worlds as a constructs of entities and association between entities. Entities: Entities are the principal data object about which information is to be collected. It is classified as independent or dependent. An independent entity is one that does not rely on another for identification whereas dependent is one that relies on another for identification. Special entity types are associative, and subtype entities. Relationship: a relationship represents as association between two or more entities. Relationships are classified in terms of degree, connectivity, cardinality and existence. Attributes: Attributes describes the entity of which they are associated. Attributes can be classified as identifiers or descriptors. Identifiers, or keys, uniquely identify an instance of an entity. A descriptor describes a non-unique characteristic of an entity instance. Degree of relationship: It is the number of entities associated with the relationship Connectivity and cardinality: It describes the mapping of associated entity instance in a relationship. The value of connectivity are one-to-one (1: 1), one-to-many (1 : N), Many-to-Many (M : N). Direction: Direction of a relationship indicates the originating entity of a binary relationship the entity from which a relationship originates is the parent entity and entity where relationship terminates is the child entity. Existence: Existence denotes whether the existence of an entity instance is dependent upon the existence of another, related, entity instance. ER Notations: Basic ER notations are as: 1) Entities are represented by labeled rectangles. 2) Relationships are represented by a solid line connecting two entities. 3) Attributes when included are listed inside the entity rectangle. Attributes which are identifiers are underlined 4) Cardinality of many is represented by a line ending in a crow’s foot. If the crow’s foot is omitted, the cardinality is one. 5) Existence is represented by placing a circle or a perpendicular bar on the line. Explain the first 3 Normal Forms taking the help of an un-normalized relation and reducing it to 3 NF. Answer Normalization is the process of efficiently organizing data in a database. First Normal Form (1NF): A relation which contains a repeating group is called an un-normalized relation. Therefore a relation is said to be in first normal form if it does not contain repeating groups. Second Normal Form (2NF): A relation is said to be in 2NF if it is in 1NF and no non-key attribute is functionally dependent on only a portion of the primary key. For example consider a table Software. Software packid packname tagnumber cost cmpid MST microsoft 11382 500 M223 DBS Database 11256 400 S456 FP1 IBM 11695 900 D765 FP1 IBM 11584 700 S098 As we can see that in the column packid FP1 occurs several times. This causes several problems like wastage of memory and update, inconsistent data addition and deletions problems. Therefore a relation is said to be in 2NF if it is in 1NF and contains no partial dependencies, so software table is currently is not in 2NF, Method to convert it into 2NF is as follows.
  • 3. For each subset of the set of attributes , which make up the primary key start a relation with this subset as its primary key so for software relation , now place the other attributes in such a way that we obtain minimal relation for which these subsets of attributes are primary key, so we obtain (packid, packname) (tagnumber,cmpid) (packid,tagnumber,cost) So each of above relation can now be given a name which is descriptive of the meaning of the relation e.g. PACK, COMP, SOFT. Third Normal Form (3NF): A relation is said to be in 3NF if it is in 2NF and if the only determinants it has are candidate keys. Where an attribute which determines another attribute is called determinant. Explain the concept of Data Mining? How it is related with data warehouse. Answer Data mining: Data mining is basically used to discover new rules and patterns from the supplied data. It is also said that it addresses inductive knowledge. Following are the five knowledge discovered during data mining Association rule: these rules correlate the presence of a set of items with another range of values for another set of variables. Classification hierarchies: the goal is to work from an existing set of events or transactions to create a hierarchy of classes. Sequential patterns: A sequence of actions or events is sought. Patterns with time series: Similarities can be detected within position of time series of data, which is a sequence of data taken at regular interval such as daily sales or daily closing stock prices. Clustering: A given population of events can be partitioned into set of similar elements. As data mining concept can be applied to large variety of decision making contexts in business, some particular areas are Marketing, Finance, Manufacturing, Health care Further Data mining is related with data warehouse as follows: As goal of data warehouse is to support decision making with data. Data mining can be used in conjunction with a data warehouse to help with certain types of decisions. Data mining can be applied to operational databases with individual transactions. To make data mining more efficient, the data warehouse should have an aggregated or summarized collection of data. Data mining helps in extracting meaningful new patterns that cannot be found by merely querying or processing data in the data warehouse. Data mining application should therefore be strongly considered early, during the design of the data warehouse. Also data mining tools should be designed to facilitate their use in conjunction with data warehouse. In fact for very large databases running into terabytes of data, successful use of data mining applications will depend first on the construction of a data warehouse. Therefore data warehouse provides access to data for complex analysis, knowledge discovery and decision making and they support high-performance on an organization’s data and information whereas data mining is used to discover new rules and patterns from the supplied data.
  • 4. Write the SQL queries using Data Manipulation Language (DML) statements. (a) Insert values into student table with field names using insert command (b) Display the table student using select command (c) Update student address in student table using update command. (d) Delete a row from student table. Answer Creating a Table: CREATE TABLE STUDENT ( Student INT, First name VARCHAR (20), Last name VARCHAR (20), Gender ENUM (‘M’,’F’), Address VARCHAR (100) ) (a) Insert values into student table with field names using insert command INSERT INTO STUDENT(StudentID,Firstname,Lastname,Gender,Address)VALUES(234,nikhil,singh,M,H-12 Delhi); (b) Display the table student using select command SELECT StudentID,Firstname,Lastname,Gender,Address FROM STUDENT; (c) Update student address in student table using update command UPDATE STUDENT address = H-29 new Delhi WHERE ITEM = ‘H-12 Delhi’; (d) Delete a row from student table DELETE FROM STUDENT WHERE studentID=’234’ AND first name = Nikhil AND last name = Singh ;
  • 5. Create the payroll database considering table employee. (a) Do simple queries on the above database. i. List all information of the above both tables. ii. List the empno, ename, jobtitle,and hiredate of employee from the employee table. (b) List the name, salary of the employees who are clerks. (c) List the name,job,salary of every employee joined on certain date. (say ‘december 17,1980’) (d) List name and annual salary of all the employees. (e) List the employees who have salary between certain range (say between Rs. 1000 & 2000) Answer CREATE TABLE employee ( emp_no INT ename VARCHAR(20) job title VARCHAR(16) salary INT hiredate DATE ); (a) (1) List all information of the above both tables. SELECT * FROM employee; (2) List the empno, ename, jobtitle,and hiredate of employee from the employee table SELECT empno, ename, jobtitle, hiredate FROM employee; (b) List the name, salary of the employees who are clerks SELECT ename, salary FROM employee WHERE job title = ‘clerks’; (c) List the name,job,salary of every employee joined on certain date. (say ‘december 17,1980’) SELECT ename, job title, salary FROM employee WHERE hiredate = ‘december 17,1980’; (d) List name and annual salary of all the employees. SELECT ename, SUM(salary) FROM employee GROUP BY ename; (e) List the employees who have salary between certain range (say between Rs. 1000 & 2000) SELECT ename FROM employee WHERE salary BETWEEN 1000 AND 2000;