SlideShare uma empresa Scribd logo
1 de 19
what is the primary key super key
foreign key and candidate key in the
dbms
super key :]
A Super key is any combination of fields within a table that uniquely identifies each
record within that table.
Candidate Key
A candidate is a subset of a super key. A candidate key is a single field or the least combination
of fields that uniquely identifies each record in the table. The least combination of fields
distinguishes a candidate key from a super key. Every table must have at least one candidate key
but at the same time can have several.
• As an example we might have a student_id that uniquely identifies the students in a student
table. This would be a candidate key. But in the same table we might have the student’s first
name and last name that also, when combined, uniquely identify the student in a student
table. These would both be candidate keys.
In order to be eligible for a candidate key it must pass certain criteria.
• It must contain unique values
• It must not contain null values
• It contains the minimum number of fields to ensure uniqueness
• It must uniquely identify each record in the table
• Once your candidate keys have been identified you can now select one to be your primary
key
primary key
A primary key is a candidate key that is most appropriate to be the main reference key for the
table. As its name suggests, it is the primary key of reference for the table and is used
throughout the database to help establish relationships with other tables. As with any
candidate key the primary key must contain unique values, must never be null and uniquely
identify each record in the table.
As an example, a student id might be a primary key in a student table, a department code in a
table of all departments in an organisation. This module has the code DH3D 35 that is no doubt
used in a database somewhere to identify RDBMS as a unit in a table of modules. In the table
below we have selected the candidate key student_id to be our most appropriate primary key
Primary keys are mandatory for every table each record must have a value for its primary key.
When choosing a primary key from the pool of candidate keys always choose a single simple
key over a composite key.
• Foreign Key
A foreign key is generally a primary key from one table that appears as a field in another where
the first table has a relationship to the second. In other words, if we had a table A with a
primary key X that linked to a table B where X was a field in B, then X would be a foreign key in
B.
An example might be a student table that contains the course_id the student is attending.
Another table lists the courses on offer with course_id being the primary key. The 2 tables are
linked through course_id and as such course_id would be a foreign key in the student table.
Query processor :A query processor is one of the major components of a
relational database or an electronic database in which data is stored in tables of rows and
columns. It complements the storage engine, which writes and reads data to and from storage
media.
FULL OUTER JOIN Keyword
The FULL OUTER JOIN keyword returns all rows from the left table (table1) and from the right
table (table2).
The FULL OUTER JOIN keyword combines the result of both LEFT and RIGHT joins.
SQL FULL OUTER JOIN Syntax:
SELECT column_name(s)
FROM table1
FULL OUTER JOIN table2
ON table1.column_name=table2.column_name;
Inner join:
The most frequently used and important of the joins is the INNER JOIN. They are also referred to
as an EQUIJOIN.
The INNER JOIN creates a new result table by combining column values of two tables (table1
and table2) based upon the join-predicate. The query compares each row of table1 with each
row of table2 to find all pairs of rows which satisfy the join-predicate. When the join-predicate is
satisfied, column values for each matched pair of rows of A and B are combined into a result
row.
• Syntax:
The basic syntax of INNER JOIN is as follows:
SELECT table1.column1, table2.column2...
FROM table1
INNER JOIN table2
ON table1.common_field = table2.common_field;
What are five main functions of a database administrator?
Five main functions of a database administrator are:
• To create the scheme definition
• To define the storage structure and access
methods
• To modify the scheme and/or physical
organization when necessary
• To grant authorization for data access
• To specify integrity constraints
The major functions of these various phases are summarized
as follows:
1. Database planning. Support overall organizational business plan. Develop a data
administration plan and design the database environment.
2. Database analysis. Identifying data entities used by the organization, relationships, and
documenting them (ER diagram). Define business rules and operational requirements.
3. Database design. Includes logical and physical design. Convert ER diagram to relational
tables. Design integrity controls.
4. Database implementation. First step is creation and initial load of the database - called
populating the database. Resolve data inconsistencies. Establish security controls. Establish
backup and recovery procedures. Train system users.
5. Operation and maintenance. Update database to keep it current - done by application
programs. Must include auditing the database for tuning and reorganization.
6. Growth and change. Modify the database to reflect changes in the organization. Monitor
database performance for efficiency and customer satisfaction.
• Difference between strong and weak entity in dbms:
Generalization
Generalization is a bottom-up approach in which two lower level entities combine to form a
higher level entity. In generalization, the higher level entity can also combine with other lower
level entity to make further higher level entity.
Specialization
Specialization is opposite to Generalization. It is a top-down approach in which one higher level
entity can be broken down into two lower level entity. In specialization, some higher level
entities may not have lower-level entity sets at all.
• Aggregration
Aggregration is a process when relation between two entity is treated as a single entity. Here
the relation between Center and Course, is acting as an Entity in relation with Visitor.
Primary index:
• It is an ordered file whose records are of fixed length
with two fields.
• Only based on the primary key.
• The total number of entries in the index is the same as
the number of disk blocks in the ordered data file.
• Primary index is a king of nondense (sparse) index.
• There may be at most one primary index for a file
• Needs less storage space.
Difference between primary and secondary
index in dbms
Secondary index
• It provides a secondary means of accessing a file
for which some primary access already exists.
• May be based on candidate key or secondary key.
• It has a large number entries due to duplication.
• Secondary index is a kind of dense index.
• There may be more than one secondary indexes
for the same file.
• Needs more storage space and longer search
time.
Definition - What does Hashing mean
• Hashing is also a method of sorting key values in a database
table in an efficient manner.
• Hashing is one way to enable security during the process of
message transmission when the message is intended for a
particular recipient only. A formula generates the hash, which
helps to protect the security of the transmission from
unauthorized users.
• Hashing is generating a value or values from a string of text using
a mathematical function
Triggers - a trigger is a piece of SQL to execute either before or after an update, insert, or
delete in a database. An example of a trigger in plain English might be something like: before
updating a customer record, save a copy of the current record. Which would look something
like:
CREATE TRIGGER triggerName
AFTER UPDATE
INSERT INTO CustomerLog (blah, blah, blah)
SELECT blah, blah, blah FROM deleted
Assertions - An assertion is a piece of SQL which makes sure a condition is satisfied or it
stops action being taken on a database object. It could mean locking out the whole table or
even the whole database.
DBMS

Mais conteúdo relacionado

Mais procurados (20)

Types Of Keys in DBMS
Types Of Keys in DBMSTypes Of Keys in DBMS
Types Of Keys in DBMS
 
Join
JoinJoin
Join
 
Normalization PRESENTATION
Normalization PRESENTATIONNormalization PRESENTATION
Normalization PRESENTATION
 
Nested Queries Lecture
Nested Queries LectureNested Queries Lecture
Nested Queries Lecture
 
Dbms keys
Dbms keysDbms keys
Dbms keys
 
SQL JOINS
SQL JOINSSQL JOINS
SQL JOINS
 
Types of keys dbms
Types of keys dbmsTypes of keys dbms
Types of keys dbms
 
Sql functions
Sql functionsSql functions
Sql functions
 
Database Normalization
Database NormalizationDatabase Normalization
Database Normalization
 
Joins And Its Types
Joins And Its TypesJoins And Its Types
Joins And Its Types
 
B tree
B treeB tree
B tree
 
Mysql datatypes
Mysql datatypesMysql datatypes
Mysql datatypes
 
Sparse matrix and its representation data structure
Sparse matrix and its representation data structureSparse matrix and its representation data structure
Sparse matrix and its representation data structure
 
Sql operators & functions 3
Sql operators & functions 3Sql operators & functions 3
Sql operators & functions 3
 
SQL Functions and Operators
SQL Functions and OperatorsSQL Functions and Operators
SQL Functions and Operators
 
Database Keys
Database KeysDatabase Keys
Database Keys
 
DBMS: Types of keys
DBMS:  Types of keysDBMS:  Types of keys
DBMS: Types of keys
 
Tree Data Structure by Daniyal Khan
Tree Data Structure by Daniyal KhanTree Data Structure by Daniyal Khan
Tree Data Structure by Daniyal Khan
 
Lenguaje estructurado de consulta
Lenguaje estructurado de consultaLenguaje estructurado de consulta
Lenguaje estructurado de consulta
 
normalization
normalizationnormalization
normalization
 

Destaque

E212d9a797dbms chapter3 b.sc2 (2)
E212d9a797dbms chapter3 b.sc2 (2)E212d9a797dbms chapter3 b.sc2 (2)
E212d9a797dbms chapter3 b.sc2 (2)Mukund Trivedi
 
Decomposition using Functional Dependency
Decomposition using Functional DependencyDecomposition using Functional Dependency
Decomposition using Functional DependencyRaj Naik
 
Types Of Join In Sql Server - Join With Example In Sql Server
Types Of Join In Sql Server - Join With Example In Sql ServerTypes Of Join In Sql Server - Join With Example In Sql Server
Types Of Join In Sql Server - Join With Example In Sql Serverprogrammings guru
 
Dbms Lec Uog 02
Dbms Lec Uog 02Dbms Lec Uog 02
Dbms Lec Uog 02smelltulip
 
Diffrence between dbms and rdbms
Diffrence between dbms and rdbmsDiffrence between dbms and rdbms
Diffrence between dbms and rdbmsJitendra Thakur
 
Entity Relationship Diagram
Entity Relationship DiagramEntity Relationship Diagram
Entity Relationship DiagramRakhi Mukherji
 
Entity relationship diagram (erd)
Entity relationship diagram (erd)Entity relationship diagram (erd)
Entity relationship diagram (erd)tameemyousaf
 

Destaque (11)

E212d9a797dbms chapter3 b.sc2 (2)
E212d9a797dbms chapter3 b.sc2 (2)E212d9a797dbms chapter3 b.sc2 (2)
E212d9a797dbms chapter3 b.sc2 (2)
 
Decomposition using Functional Dependency
Decomposition using Functional DependencyDecomposition using Functional Dependency
Decomposition using Functional Dependency
 
Entity relationship diagram for dummies
Entity relationship diagram for dummiesEntity relationship diagram for dummies
Entity relationship diagram for dummies
 
DBMS Keys
DBMS KeysDBMS Keys
DBMS Keys
 
Types Of Join In Sql Server - Join With Example In Sql Server
Types Of Join In Sql Server - Join With Example In Sql ServerTypes Of Join In Sql Server - Join With Example In Sql Server
Types Of Join In Sql Server - Join With Example In Sql Server
 
Dbms Lec Uog 02
Dbms Lec Uog 02Dbms Lec Uog 02
Dbms Lec Uog 02
 
Diffrence between dbms and rdbms
Diffrence between dbms and rdbmsDiffrence between dbms and rdbms
Diffrence between dbms and rdbms
 
Entity Relationship Diagram
Entity Relationship DiagramEntity Relationship Diagram
Entity Relationship Diagram
 
Functional dependency
Functional dependencyFunctional dependency
Functional dependency
 
Databases: Normalisation
Databases: NormalisationDatabases: Normalisation
Databases: Normalisation
 
Entity relationship diagram (erd)
Entity relationship diagram (erd)Entity relationship diagram (erd)
Entity relationship diagram (erd)
 

Semelhante a DBMS

Sql interview q&a
Sql interview q&aSql interview q&a
Sql interview q&aSyed Shah
 
Chapter-5 The Relational Data Model
Chapter-5 The Relational Data ModelChapter-5 The Relational Data Model
Chapter-5 The Relational Data ModelKunal Anand
 
Introduction DBMS, RDBMS and SQL
Introduction DBMS, RDBMS and SQLIntroduction DBMS, RDBMS and SQL
Introduction DBMS, RDBMS and SQLMurageppa-QA
 
Introduction of DBMS
Introduction of DBMSIntroduction of DBMS
Introduction of DBMSYouQue ™
 
Data Base Management System.pdf
Data Base Management System.pdfData Base Management System.pdf
Data Base Management System.pdfTENZING LHADON
 
Dbms interview questions
Dbms interview questionsDbms interview questions
Dbms interview questionsambika93
 
Sql interview questions and answers
Sql interview questions and  answersSql interview questions and  answers
Sql interview questions and answerssheibansari
 
DATABASE CONCEPTS AND PRACTICAL EXAMPLES
DATABASE CONCEPTS AND PRACTICAL EXAMPLESDATABASE CONCEPTS AND PRACTICAL EXAMPLES
DATABASE CONCEPTS AND PRACTICAL EXAMPLESNathRam2
 
COMPUTERS Database
COMPUTERS Database COMPUTERS Database
COMPUTERS Database Rc Os
 
The Relational Database Model
The Relational Database ModelThe Relational Database Model
The Relational Database ModelShishir Aryal
 

Semelhante a DBMS (20)

B & c
B & cB & c
B & c
 
Codds rules & keys
Codds rules & keysCodds rules & keys
Codds rules & keys
 
Unit 2 DBMS.pptx
Unit 2 DBMS.pptxUnit 2 DBMS.pptx
Unit 2 DBMS.pptx
 
Sql interview q&a
Sql interview q&aSql interview q&a
Sql interview q&a
 
Chapter-5 The Relational Data Model
Chapter-5 The Relational Data ModelChapter-5 The Relational Data Model
Chapter-5 The Relational Data Model
 
DATABASE-1.pptx
DATABASE-1.pptxDATABASE-1.pptx
DATABASE-1.pptx
 
Introduction DBMS, RDBMS and SQL
Introduction DBMS, RDBMS and SQLIntroduction DBMS, RDBMS and SQL
Introduction DBMS, RDBMS and SQL
 
Introduction of DBMS
Introduction of DBMSIntroduction of DBMS
Introduction of DBMS
 
Data Base Management System.pdf
Data Base Management System.pdfData Base Management System.pdf
Data Base Management System.pdf
 
Dbms interview questions
Dbms interview questionsDbms interview questions
Dbms interview questions
 
Database Basics
Database BasicsDatabase Basics
Database Basics
 
demo2.ppt
demo2.pptdemo2.ppt
demo2.ppt
 
DBMS-Unit-2.pptx
DBMS-Unit-2.pptxDBMS-Unit-2.pptx
DBMS-Unit-2.pptx
 
Sql interview questions and answers
Sql interview questions and  answersSql interview questions and  answers
Sql interview questions and answers
 
DATABASE CONCEPTS AND PRACTICAL EXAMPLES
DATABASE CONCEPTS AND PRACTICAL EXAMPLESDATABASE CONCEPTS AND PRACTICAL EXAMPLES
DATABASE CONCEPTS AND PRACTICAL EXAMPLES
 
COMPUTERS Database
COMPUTERS Database COMPUTERS Database
COMPUTERS Database
 
Ch10
Ch10Ch10
Ch10
 
NMEC RD_UNIT 1.ppt
NMEC RD_UNIT 1.pptNMEC RD_UNIT 1.ppt
NMEC RD_UNIT 1.ppt
 
computer-210809080138.pdf
computer-210809080138.pdfcomputer-210809080138.pdf
computer-210809080138.pdf
 
The Relational Database Model
The Relational Database ModelThe Relational Database Model
The Relational Database Model
 

Último

Minimum and Maximum Modes of microprocessor 8086
Minimum and Maximum Modes of microprocessor 8086Minimum and Maximum Modes of microprocessor 8086
Minimum and Maximum Modes of microprocessor 8086anil_gaur
 
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoorTop Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoordharasingh5698
 
Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayEpec Engineered Technologies
 
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
 
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Wakad Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance Bookingroncy bisnoi
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performancesivaprakash250
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756dollysharma2066
 
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...SUHANI PANDEY
 
Design For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startDesign For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startQuintin Balsdon
 
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfKamal Acharya
 
Hostel management system project report..pdf
Hostel management system project report..pdfHostel management system project report..pdf
Hostel management system project report..pdfKamal Acharya
 
22-prompt engineering noted slide shown.pdf
22-prompt engineering noted slide shown.pdf22-prompt engineering noted slide shown.pdf
22-prompt engineering noted slide shown.pdf203318pmpc
 
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...Arindam Chakraborty, Ph.D., P.E. (CA, TX)
 
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
 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Bookingdharasingh5698
 

Último (20)

Minimum and Maximum Modes of microprocessor 8086
Minimum and Maximum Modes of microprocessor 8086Minimum and Maximum Modes of microprocessor 8086
Minimum and Maximum Modes of microprocessor 8086
 
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
 
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoorTop Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
 
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort ServiceCall Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
 
Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power Play
 
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
 
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Wakad Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance Booking
 
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced LoadsFEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performance
 
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak HamilCara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
 
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
 
Design For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startDesign For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the start
 
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
 
Hostel management system project report..pdf
Hostel management system project report..pdfHostel management system project report..pdf
Hostel management system project report..pdf
 
22-prompt engineering noted slide shown.pdf
22-prompt engineering noted slide shown.pdf22-prompt engineering noted slide shown.pdf
22-prompt engineering noted slide shown.pdf
 
Call Girls in Netaji Nagar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Netaji Nagar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort ServiceCall Girls in Netaji Nagar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Netaji Nagar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
 
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
 
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
 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
 

DBMS

  • 1. what is the primary key super key foreign key and candidate key in the dbms super key :] A Super key is any combination of fields within a table that uniquely identifies each record within that table.
  • 2. Candidate Key A candidate is a subset of a super key. A candidate key is a single field or the least combination of fields that uniquely identifies each record in the table. The least combination of fields distinguishes a candidate key from a super key. Every table must have at least one candidate key but at the same time can have several.
  • 3. • As an example we might have a student_id that uniquely identifies the students in a student table. This would be a candidate key. But in the same table we might have the student’s first name and last name that also, when combined, uniquely identify the student in a student table. These would both be candidate keys. In order to be eligible for a candidate key it must pass certain criteria. • It must contain unique values • It must not contain null values • It contains the minimum number of fields to ensure uniqueness • It must uniquely identify each record in the table • Once your candidate keys have been identified you can now select one to be your primary key
  • 4. primary key A primary key is a candidate key that is most appropriate to be the main reference key for the table. As its name suggests, it is the primary key of reference for the table and is used throughout the database to help establish relationships with other tables. As with any candidate key the primary key must contain unique values, must never be null and uniquely identify each record in the table. As an example, a student id might be a primary key in a student table, a department code in a table of all departments in an organisation. This module has the code DH3D 35 that is no doubt used in a database somewhere to identify RDBMS as a unit in a table of modules. In the table below we have selected the candidate key student_id to be our most appropriate primary key Primary keys are mandatory for every table each record must have a value for its primary key. When choosing a primary key from the pool of candidate keys always choose a single simple key over a composite key.
  • 5. • Foreign Key A foreign key is generally a primary key from one table that appears as a field in another where the first table has a relationship to the second. In other words, if we had a table A with a primary key X that linked to a table B where X was a field in B, then X would be a foreign key in B. An example might be a student table that contains the course_id the student is attending. Another table lists the courses on offer with course_id being the primary key. The 2 tables are linked through course_id and as such course_id would be a foreign key in the student table.
  • 6. Query processor :A query processor is one of the major components of a relational database or an electronic database in which data is stored in tables of rows and columns. It complements the storage engine, which writes and reads data to and from storage media.
  • 7. FULL OUTER JOIN Keyword The FULL OUTER JOIN keyword returns all rows from the left table (table1) and from the right table (table2). The FULL OUTER JOIN keyword combines the result of both LEFT and RIGHT joins. SQL FULL OUTER JOIN Syntax: SELECT column_name(s) FROM table1 FULL OUTER JOIN table2 ON table1.column_name=table2.column_name;
  • 8. Inner join: The most frequently used and important of the joins is the INNER JOIN. They are also referred to as an EQUIJOIN. The INNER JOIN creates a new result table by combining column values of two tables (table1 and table2) based upon the join-predicate. The query compares each row of table1 with each row of table2 to find all pairs of rows which satisfy the join-predicate. When the join-predicate is satisfied, column values for each matched pair of rows of A and B are combined into a result row. • Syntax: The basic syntax of INNER JOIN is as follows: SELECT table1.column1, table2.column2... FROM table1 INNER JOIN table2 ON table1.common_field = table2.common_field;
  • 9. What are five main functions of a database administrator? Five main functions of a database administrator are: • To create the scheme definition • To define the storage structure and access methods • To modify the scheme and/or physical organization when necessary • To grant authorization for data access • To specify integrity constraints
  • 10. The major functions of these various phases are summarized as follows: 1. Database planning. Support overall organizational business plan. Develop a data administration plan and design the database environment. 2. Database analysis. Identifying data entities used by the organization, relationships, and documenting them (ER diagram). Define business rules and operational requirements. 3. Database design. Includes logical and physical design. Convert ER diagram to relational tables. Design integrity controls. 4. Database implementation. First step is creation and initial load of the database - called populating the database. Resolve data inconsistencies. Establish security controls. Establish backup and recovery procedures. Train system users. 5. Operation and maintenance. Update database to keep it current - done by application programs. Must include auditing the database for tuning and reorganization. 6. Growth and change. Modify the database to reflect changes in the organization. Monitor database performance for efficiency and customer satisfaction.
  • 11. • Difference between strong and weak entity in dbms:
  • 12. Generalization Generalization is a bottom-up approach in which two lower level entities combine to form a higher level entity. In generalization, the higher level entity can also combine with other lower level entity to make further higher level entity.
  • 13. Specialization Specialization is opposite to Generalization. It is a top-down approach in which one higher level entity can be broken down into two lower level entity. In specialization, some higher level entities may not have lower-level entity sets at all.
  • 14. • Aggregration Aggregration is a process when relation between two entity is treated as a single entity. Here the relation between Center and Course, is acting as an Entity in relation with Visitor.
  • 15. Primary index: • It is an ordered file whose records are of fixed length with two fields. • Only based on the primary key. • The total number of entries in the index is the same as the number of disk blocks in the ordered data file. • Primary index is a king of nondense (sparse) index. • There may be at most one primary index for a file • Needs less storage space. Difference between primary and secondary index in dbms
  • 16. Secondary index • It provides a secondary means of accessing a file for which some primary access already exists. • May be based on candidate key or secondary key. • It has a large number entries due to duplication. • Secondary index is a kind of dense index. • There may be more than one secondary indexes for the same file. • Needs more storage space and longer search time.
  • 17. Definition - What does Hashing mean • Hashing is also a method of sorting key values in a database table in an efficient manner. • Hashing is one way to enable security during the process of message transmission when the message is intended for a particular recipient only. A formula generates the hash, which helps to protect the security of the transmission from unauthorized users. • Hashing is generating a value or values from a string of text using a mathematical function
  • 18. Triggers - a trigger is a piece of SQL to execute either before or after an update, insert, or delete in a database. An example of a trigger in plain English might be something like: before updating a customer record, save a copy of the current record. Which would look something like: CREATE TRIGGER triggerName AFTER UPDATE INSERT INTO CustomerLog (blah, blah, blah) SELECT blah, blah, blah FROM deleted Assertions - An assertion is a piece of SQL which makes sure a condition is satisfied or it stops action being taken on a database object. It could mean locking out the whole table or even the whole database.