The document discusses Codd's rules for relational database management systems (RDBMS). It explains the 13 rules, which include that data should only be represented as values in tables, null values must be supported, and the database description must be queryable using the same relational language as the data. It also defines what constitutes an RDBMS, describes database concepts like normalization, and provides examples of relationships and integrity rules.
What are the top 100 SQL Interview Questions and Answers in 2014? Based on the most popular SQL questions asked in interview, we've compiled a list of the 100 most popular SQL interview questions in 2014.
This pdf includes oracle sql interview questions and answers, sql query interview questions and answers, sql interview questions and answers for freshers etc and is perfect for those who're appearing for a linux interview in top IT companies like HCL, Infosys, TCS, Wipro, Tech Mahindra, Cognizant etc
This list includes SQL interview questions in the below categories:
top 100 sql interview questions and answers
top 100 java interview questions and answers
top 100 c interview questions and answers
top 50 sql interview questions and answers
top 100 interview questions and answers book
sql interview questions and answers pdf
oracle sql interview questions and answers
sql query interview questions and answers
sql interview questions and answers for freshers
SQL Queries Interview Questions and Answers
SQL Interview Questions and Answers
Top 80 + SQL Query Interview Questions and Answers
Top 20 SQL Interview Questions with Answers
Sql Server Interviews Questions and Answers
100 Mysql interview questions and answers
SQL Queries Interview Questions
SQL Query Interview Questions and Answers with Examples
Mysql interview questions and answers for freshers and experienced
This is my presentation at SQLBits 8, Brighton, 9th April 2011. This session is about advanced dimensional modelling topics such as Fact Table Primary Key, Vertical Fact Tables, Aggregate Fact Tables, SCD Type 6, Snapshotting Transaction Fact Tables, 1 or 2 Dimensions, Dealing with Currency Rates, When to Snowflake, Dimensions with Multi Valued Attributes, Transaction-Level Dimensions, Very Large Dimensions, A Dimension With Only 1 Attribute, Rapidly Changing Dimensions, Banding Dimension Rows, Stamping Dimension Rows and Real Time Fact Table. Prerequisites: You need have a basic knowledge of dimensional modelling and relational database design.
My name is Vincent Rainardi. I am a data warehouse & BI architect. I wrote a book on SQL Server data warehousing & BI, as well as many articles on my blog, www.datawarehouse.org.uk. I welcome questions and discussions on data warehousing on vrainardi@gmail.com. Enjoy the presentation.
What are the top 100 SQL Interview Questions and Answers in 2014? Based on the most popular SQL questions asked in interview, we've compiled a list of the 100 most popular SQL interview questions in 2014.
This pdf includes oracle sql interview questions and answers, sql query interview questions and answers, sql interview questions and answers for freshers etc and is perfect for those who're appearing for a linux interview in top IT companies like HCL, Infosys, TCS, Wipro, Tech Mahindra, Cognizant etc
This list includes SQL interview questions in the below categories:
top 100 sql interview questions and answers
top 100 java interview questions and answers
top 100 c interview questions and answers
top 50 sql interview questions and answers
top 100 interview questions and answers book
sql interview questions and answers pdf
oracle sql interview questions and answers
sql query interview questions and answers
sql interview questions and answers for freshers
SQL Queries Interview Questions and Answers
SQL Interview Questions and Answers
Top 80 + SQL Query Interview Questions and Answers
Top 20 SQL Interview Questions with Answers
Sql Server Interviews Questions and Answers
100 Mysql interview questions and answers
SQL Queries Interview Questions
SQL Query Interview Questions and Answers with Examples
Mysql interview questions and answers for freshers and experienced
This is my presentation at SQLBits 8, Brighton, 9th April 2011. This session is about advanced dimensional modelling topics such as Fact Table Primary Key, Vertical Fact Tables, Aggregate Fact Tables, SCD Type 6, Snapshotting Transaction Fact Tables, 1 or 2 Dimensions, Dealing with Currency Rates, When to Snowflake, Dimensions with Multi Valued Attributes, Transaction-Level Dimensions, Very Large Dimensions, A Dimension With Only 1 Attribute, Rapidly Changing Dimensions, Banding Dimension Rows, Stamping Dimension Rows and Real Time Fact Table. Prerequisites: You need have a basic knowledge of dimensional modelling and relational database design.
My name is Vincent Rainardi. I am a data warehouse & BI architect. I wrote a book on SQL Server data warehousing & BI, as well as many articles on my blog, www.datawarehouse.org.uk. I welcome questions and discussions on data warehousing on vrainardi@gmail.com. Enjoy the presentation.
Learn What is inforamatica powercenter and its uses, Informatica powercenter designer,informatica powercenter repository, oltp system informatica,olap system informatica,informatica powercenter etl processing
Here i am giving some sql queries which is helpful for practicing in sql server for learning more sql interview questions you can refer this link http://skillgun.com/sql/interview-questions-and-answers
(** MYSQL DBA Certification Training https://www.edureka.co/mysql-dba **)
This Edureka PPT on SQL Joins will discuss the various types of Joins used in SQL Server with examples. The following topics will be covered in this PPT:
Introduction to SQL
What are Joins?
Types of Joins
FAQs about Joins
Follow us to never miss an update in the future.
YouTube: https://www.youtube.com/user/edurekaIN
Instagram: https://www.instagram.com/edureka_learning/
Facebook: https://www.facebook.com/edurekaIN/
Twitter: https://twitter.com/edurekain
LinkedIn: https://www.linkedin.com/company/edureka
Top 65 SQL Interview Questions and Answers | EdurekaEdureka!
** MYSQL DBA Certification Training https://www.edureka.co/mysql-dba **
This Edureka PPT on Top 65 SQL Interview Question and Answers will help you to prepare yourself for Database Administrators Interviews. It covers questions for beginners, intermediate and experienced professionals.
Follow us to never miss an update in the future.
Instagram: https://www.instagram.com/edureka_learning/
Facebook: https://www.facebook.com/edurekaIN/
Twitter: https://twitter.com/edurekain
LinkedIn: https://www.linkedin.com/company/edureka
50-55 hours Training + Assignments + Actual Project Based Case Studies
All attendees will receive,
Assignment after each module, Video recording of every session
Notes and study material for examples covered.
Access to the Training Blog & Repository of Materials
• Process for heuristics optimization
1. The parser of a high-level query generates an initial internal representation;
2. Apply heuristics rules to optimize the internal representation.
3. A query execution plan is generated to execute groups of operations based on the access paths available on the files involved in the query.
This presentation deals with the fundamentals of SQL, Installation and Database concepts. Presented by our team in Alphalogic Inc: https://www.alphalogicinc.com/
Learn What is inforamatica powercenter and its uses, Informatica powercenter designer,informatica powercenter repository, oltp system informatica,olap system informatica,informatica powercenter etl processing
Here i am giving some sql queries which is helpful for practicing in sql server for learning more sql interview questions you can refer this link http://skillgun.com/sql/interview-questions-and-answers
(** MYSQL DBA Certification Training https://www.edureka.co/mysql-dba **)
This Edureka PPT on SQL Joins will discuss the various types of Joins used in SQL Server with examples. The following topics will be covered in this PPT:
Introduction to SQL
What are Joins?
Types of Joins
FAQs about Joins
Follow us to never miss an update in the future.
YouTube: https://www.youtube.com/user/edurekaIN
Instagram: https://www.instagram.com/edureka_learning/
Facebook: https://www.facebook.com/edurekaIN/
Twitter: https://twitter.com/edurekain
LinkedIn: https://www.linkedin.com/company/edureka
Top 65 SQL Interview Questions and Answers | EdurekaEdureka!
** MYSQL DBA Certification Training https://www.edureka.co/mysql-dba **
This Edureka PPT on Top 65 SQL Interview Question and Answers will help you to prepare yourself for Database Administrators Interviews. It covers questions for beginners, intermediate and experienced professionals.
Follow us to never miss an update in the future.
Instagram: https://www.instagram.com/edureka_learning/
Facebook: https://www.facebook.com/edurekaIN/
Twitter: https://twitter.com/edurekain
LinkedIn: https://www.linkedin.com/company/edureka
50-55 hours Training + Assignments + Actual Project Based Case Studies
All attendees will receive,
Assignment after each module, Video recording of every session
Notes and study material for examples covered.
Access to the Training Blog & Repository of Materials
• Process for heuristics optimization
1. The parser of a high-level query generates an initial internal representation;
2. Apply heuristics rules to optimize the internal representation.
3. A query execution plan is generated to execute groups of operations based on the access paths available on the files involved in the query.
This presentation deals with the fundamentals of SQL, Installation and Database concepts. Presented by our team in Alphalogic Inc: https://www.alphalogicinc.com/
A database management system (DBMS) is system software for creating and managing databases. The DBMS provides users and programmers with a systematic way to create, retrieve, update and manage data.
A DBMS makes it possible for end users to create, read, update and delete data in a database. The DBMS essentially serves as an interface between the database and end users or application programs, ensuring that data is consistently organized and remains easily accessible.Read more.........
The French Revolution, which began in 1789, was a period of radical social and political upheaval in France. It marked the decline of absolute monarchies, the rise of secular and democratic republics, and the eventual rise of Napoleon Bonaparte. This revolutionary period is crucial in understanding the transition from feudalism to modernity in Europe.
For more information, visit-www.vavaclasses.com
Model Attribute Check Company Auto PropertyCeline George
In Odoo, the multi-company feature allows you to manage multiple companies within a single Odoo database instance. Each company can have its own configurations while still sharing common resources such as products, customers, and suppliers.
Ethnobotany and Ethnopharmacology:
Ethnobotany in herbal drug evaluation,
Impact of Ethnobotany in traditional medicine,
New development in herbals,
Bio-prospecting tools for drug discovery,
Role of Ethnopharmacology in drug evaluation,
Reverse Pharmacology.
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdfTechSoup
In this webinar you will learn how your organization can access TechSoup's wide variety of product discount and donation programs. From hardware to software, we'll give you a tour of the tools available to help your nonprofit with productivity, collaboration, financial management, donor tracking, security, and more.
Read| The latest issue of The Challenger is here! We are thrilled to announce that our school paper has qualified for the NATIONAL SCHOOLS PRESS CONFERENCE (NSPC) 2024. Thank you for your unwavering support and trust. Dive into the stories that made us stand out!
The Roman Empire A Historical Colossus.pdfkaushalkr1407
The Roman Empire, a vast and enduring power, stands as one of history's most remarkable civilizations, leaving an indelible imprint on the world. It emerged from the Roman Republic, transitioning into an imperial powerhouse under the leadership of Augustus Caesar in 27 BCE. This transformation marked the beginning of an era defined by unprecedented territorial expansion, architectural marvels, and profound cultural influence.
The empire's roots lie in the city of Rome, founded, according to legend, by Romulus in 753 BCE. Over centuries, Rome evolved from a small settlement to a formidable republic, characterized by a complex political system with elected officials and checks on power. However, internal strife, class conflicts, and military ambitions paved the way for the end of the Republic. Julius Caesar’s dictatorship and subsequent assassination in 44 BCE created a power vacuum, leading to a civil war. Octavian, later Augustus, emerged victorious, heralding the Roman Empire’s birth.
Under Augustus, the empire experienced the Pax Romana, a 200-year period of relative peace and stability. Augustus reformed the military, established efficient administrative systems, and initiated grand construction projects. The empire's borders expanded, encompassing territories from Britain to Egypt and from Spain to the Euphrates. Roman legions, renowned for their discipline and engineering prowess, secured and maintained these vast territories, building roads, fortifications, and cities that facilitated control and integration.
The Roman Empire’s society was hierarchical, with a rigid class system. At the top were the patricians, wealthy elites who held significant political power. Below them were the plebeians, free citizens with limited political influence, and the vast numbers of slaves who formed the backbone of the economy. The family unit was central, governed by the paterfamilias, the male head who held absolute authority.
Culturally, the Romans were eclectic, absorbing and adapting elements from the civilizations they encountered, particularly the Greeks. Roman art, literature, and philosophy reflected this synthesis, creating a rich cultural tapestry. Latin, the Roman language, became the lingua franca of the Western world, influencing numerous modern languages.
Roman architecture and engineering achievements were monumental. They perfected the arch, vault, and dome, constructing enduring structures like the Colosseum, Pantheon, and aqueducts. These engineering marvels not only showcased Roman ingenuity but also served practical purposes, from public entertainment to water supply.
Instructions for Submissions thorugh G- Classroom.pptxJheel Barad
This presentation provides a briefing on how to upload submissions and documents in Google Classroom. It was prepared as part of an orientation for new Sainik School in-service teacher trainees. As a training officer, my goal is to ensure that you are comfortable and proficient with this essential tool for managing assignments and fostering student engagement.
The Art Pastor's Guide to Sabbath | Steve ThomasonSteve Thomason
What is the purpose of the Sabbath Law in the Torah. It is interesting to compare how the context of the law shifts from Exodus to Deuteronomy. Who gets to rest, and why?
We all have good and bad thoughts from time to time and situation to situation. We are bombarded daily with spiraling thoughts(both negative and positive) creating all-consuming feel , making us difficult to manage with associated suffering. Good thoughts are like our Mob Signal (Positive thought) amidst noise(negative thought) in the atmosphere. Negative thoughts like noise outweigh positive thoughts. These thoughts often create unwanted confusion, trouble, stress and frustration in our mind as well as chaos in our physical world. Negative thoughts are also known as “distorted thinking”.
Palestine last event orientationfvgnh .pptxRaedMohamed3
An EFL lesson about the current events in Palestine. It is intended to be for intermediate students who wish to increase their listening skills through a short lesson in power point.
1. http://itntechnicalinterview.blogspot.com
http://itntechnicalinterview.blogspot.com
Database Fundamentals
Explain codd’s rules.
1. Foundation Rule
A relational database management system must manage its stored data using only its relational
capabilities.
2. Information Rule
All information in the database should be represented in one and only one way - as values in a
table.
3. Guaranteed Access Rule
Each and every datum (atomic value) is guaranteed to be logically accessible by resorting to a
combination of table name, primary key value and column name.
4. Systematic Treatment of Null Values
Null values (distinct from empty character string or a string of blank characters and distinct from
zero or any other number) are supported in the fully relational DBMS for representing missing
information in a systematic way, independent of data type.
5. Dynamic On-line Catalog Based on the Relational Model
The database description is represented at the logical level in the same way as ordinary data, so
authorized users can apply the same relational language to its interrogation as they apply to
regular data.
6. Comprehensive Data Sublanguage Rule
A relational system may support several languages and various modes of terminal use. However,
there must be at least one language whose statements are expressible, per some well-defined
syntax, as character strings and whose ability to support all of the following is comprehensible:
a. data definition
b. view definition
c. data manipulation (interactive and by program)
d. integrity constraints
e. authorization
f. transaction boundaries (begin, commit, and rollback).
7. View Updating Rule
All views that are theoretically updateable are also updateable by the system.
8. High-level Insert, Update, and Delete
The capability of handling a base relation or a derived relation as a single operand applies nor
only to the retrieval of data but also to the insertion, update, and deletion of data.
9. Physical Data Independence
Application programs and terminal activities remain logically unimpaired whenever any changes
are made in either storage representation or access methods.
10. Logical Data Independence
Application programs and terminal activities remain logically unimpaired when information
preserving changes of any kind that theoretically permit unimpairment are made to the base
tables.
11. Integrity Independence
Integrity constraints specific to a particular relational database must be definable in the
relational data sublanguage and storable in the catalog, not in the application programs.
12. Distribution Independence
The data manipulation sublanguage of a relational DBMS must enable application programs and
2. http://itntechnicalinterview.blogspot.com
http://itntechnicalinterview.blogspot.com
terminal activities to remain logically unimpaired whether and whenever data are physically
centralized or distributed.
13. Nonsubversion Rule
If a relational system has or supports a low-level (single-record-at-a-time) language, that low-
level language cannot be used to subvert or bypass the integrity rules or constraints expressed
in the higher-level (multiple-records-at-a-time) relational language.
If any 6 rules are satisfied with the database then that will comes under RDBMS.
What is database?
A database is a logically coherent collection of data with some inherent meaning, representing some
aspect of real world and which is designed, built and populated with data for a specific purpose.
What is DBMS?
It is a collection of programs that enables user to create and maintain a database. In other words it is
general-purpose software that provides the users with the processes of defining, constructing and
manipulating the database for various applications.
What is RDBMS?
Relational Data Base Management Systems (RDBMS) are database management systems that maintain
data records and indices in tables. Relationships may be created and maintained across and among the
data and tables. In a relational database, relationships between data items are expressed by means of
tables. Interdependencies among these tables are expressed by data values rather than by pointers. This
allows a high degree of data independence. An RDBMS has the capability to recombine the data items
from different files, providing powerful tools for data usage.
Describe the three levels of data abstraction?
There three levels of abstraction:
1. Physical level: The lowest level of abstraction describes how data are stored.
2. Logical level: The next higher level of abstraction, describes what data are stored in database
and what relationship among those data.
3. View level: The highest level of abstraction describes only part of entire database.
Define the "integrity rules"?
There are two Integrity rules.
1. Entity Integrity: States that "Primary key cannot have NULL value"
2. Referential Integrity: States that "Foreign Key can be either a NULL value or should be Primary
Key value of other relation.
3. http://itntechnicalinterview.blogspot.com
http://itntechnicalinterview.blogspot.com
What is Data Independence?
Data independence means that "the application is independent of the storage structure and access
strategy of data". In other words, the ability to modify the schema definition in one level should not
affect the schema definition in the next higher level.
Two types of Data Independence:
1. Physical Data Independence: Modification in physical level should not affect the logical level.
2. Logical Data Independence: Modification in logical level should affect the view level.
NOTE: Logical Data Independence is more difficult to achieve
What is Data Model?
A collection of conceptual tools for describing data, data relationships data semantics and constraints.
What is Object Oriented model?
This model is based on collection of objects. An object contains values stored in instance variables with
in the object. An object also contains bodies of code that operate on the object. These bodies of code
are called methods. Objects that contain same types of values and the same methods are grouped
together into classes.
What is E-R model?
This data model is based on real world that consists of basic objects called entities and of relationship
among these objects. Entities are described in a database by a set of attributes.
What is an Entity?
It is a 'thing' in the real world with an independent existence.
What is Weak Entity set?
An entity set may not have sufficient attributes to form a primary key, and its primary key compromises
of its partial key and primary key of its parent entity, then it is said to be Weak Entity set.
What is an attribute?
It is a particular property, which describes the entity.
What is a Relation Schema and a Relation?
A relation Schema denoted by R(A1, A2, ..., An) is made up of the relation name R and the list of
attributes Ai that it contains. A relation is defined as a set of tuples. Let r be the relation which contains
set tuples (t1, t2, t3, ..., tn). Each tuple is an ordered list of n-values t=(v1,v2, ..., vn).
4. http://itntechnicalinterview.blogspot.com
http://itntechnicalinterview.blogspot.com
What is degree of a Relation?
It is the number of attribute of its relation schema.
What is Relationship?
It is an association among two or more entities.
Explain one-to-many relationship with an example?
One-to-many relationships can be implemented by splitting the data into two tables with a primary key
and foreign key relationship. Here the row in one table is referenced by one or more rows in the other
table. An example is the Employees and Departments table, where the row in the Departments table is
referenced by one or more rows in the Employees table.
Explain many-to-many relationship with an example?
Many-to-Many relationship is created between two tables by creating a junction table with the key from
both the tables forming the composite primary key of the junction table.
An example is Students, Subjects and Stud_Sub_junc tables. A student can opt for one or more subjects
in a year. Similarly a subject can be opted by one or more students. So a junction table is created to
implement the many-to-many relationship.
What is Relational Algebra?
It is procedural query language. It consists of a set of operations that take one or two relations as input
and produce a new relation.
What is primary key, foreign key and unique key?
Primary key: The primary key is used to uniquely identify each row in a table and does not allow
null values.
Foreign key: A foreign key is one or more columns whose values are derived from the primary
key values of same or different table.
Unique Key: Unique key identifies a each row in the table uniquely. Unique key allows null
values.
What is meant by query optimization?
The phase that identifies an efficient execution plan for evaluating a query that has the least estimated
cost is referred to as query optimization.
5. http://itntechnicalinterview.blogspot.com
http://itntechnicalinterview.blogspot.com
Normalization
What is normalization?
It is the process of efficiently organizing the data. It is the decomposition of a table into several tables to
remove the undesirable properties. For that the relation schema is analyzed their Functional
Dependencies (FDs) and primary key.
So it is a systematic method to decompose a table. The design must be dependency preserving, content
preserving (lossless join) and free from interrelation join constraints.
We need to have a formal algorithmic approach to find if there are problems in a proposed table design.
If the table structure is not proper then there will be problems like redundancy, insertion, deletion and
update anomalies.
Database communities have developed a series of guidelines to ensure that the databases are
normalized. These are referred to as normal forms numbered from one to six.
What is 1 NF (Normal Form)?
The domain of attribute must include only atomic (simple, indivisible) values.
What is 2NF?
A relation schema R is in 2NF if it is in 1NF and every non-prime attribute A in R is fully functionally
dependent on primary key.
What is 3NF?
A relation schema R is in 3NF if it is in 2NF and if every non prime attribute is non-transitively dependent
on primary key.
What is BCNF (Boyce-Codd Normal Form)?
A relation schema R is in BCNF if it is in 3NF and for every FD X A, X must be a candidate key.
What is Functional Dependency?
For any two tuples t1 and t2 in relation ,r,
if t1[X] = t2[X] then they have t1[Y] = t2[Y].
This means the value of X component of a tuple uniquely determines the value of component Y.
Eg. RollNo determines Name or Name is dependent on RollNo
6. http://itntechnicalinterview.blogspot.com
http://itntechnicalinterview.blogspot.com
What is Fully Functional dependency?
It is based on concept of full functional dependency. A functional dependency X Y is full functional
dependency if removal of any attribute A from X means that the dependency does not hold any more.
What is De-normalization?
De-normalization is the process of optimizing the read performance of a database by adding redundant
data or by grouping data. De-normalization is used in OLAP systems.
Transactions
What is a Transaction?
A transaction is a logical unit of work performed against a database in which all steps must be
performed or none.
What are ACID properties?
A database transaction must be Atomic, Consistent, Isolation and Durability.
Atomic: Transactions must be atomic. Transactions must fail or succeed as a single unit.
Consistent: The database must always be in consistent state. There should not be any partial
transactions
Isolation: The changes made by a user should be visible only to that user until the transaction is
committed.
Durability: Once a transaction is committed, it should be permanent and cannot be undone.
SQL
Write down the general syntax of a select statement?
The basic syntax of a select statement is
SELECT Columns | *
FROM Table_Name
[WHERE Search_Condition]
[GROUP BY Group_By_Expression]
[HAVING Search_Condition]
[ORDER BY Order_By_Expression [ASC|DESC]]
What are the differences between Truncate and Delete?
7. http://itntechnicalinterview.blogspot.com
http://itntechnicalinterview.blogspot.com
Both truncate and delete are used to delete data from a table. The following are the differences
between the truncate and delete statements.
Truncate is a DDL statement. Delete is a DML statement
Truncate does not generate rollback segments. Whereas Delete does.
In case of delete, rollback recovers data before issuing a commit. In case of truncate, you cannot
recover data.
Truncate does not fire any delete triggers created on the table. Whereas the delete does.
What are the differences between Having and Where clause?
The Where clause filters rows before grouping. Having clause filters rows after grouping.
You cannot use aggregate functions in Where clause. In Having clause, you can use aggregate
functions.
How to delete duplicate records in a table?
DELETE FROM <table name>
WHERE rowid in
(SELECT MAX(rowid) FROM <table name>
Group by <primary key columns>;
What are the differences between UNION and UNION ALL.
Union and union all are used to merge rows from two or more tables.
Union set operator removes duplicate records. Whereas union all does not.
Union operator sorts the data in ascending order. union all does not.
Union all is faster than union operator.
What is ROWID and rownum in oracle?
The ROWID is a unique database-wide physical address for every row on every table. Once
assigned (when the row is first inserted into the database), it never changes until the row is deleted or
the table is dropped.
The ROWID consists of the following three components, the combination of which uniquely
identifies the physical storage location of the row.
Oracle database file number, which contains the block with the rows
Oracle block address, which contains the row
The row within the block (because each block can hold many rows)
The ROWID is used internally in indexes as a quick means of retrieving rows with a particular key
value. Application developers also use it in SQL statements as a quick way to access a row once they
know the ROWID
Rownum is temporary serial number allocated to each returned row during query execution. Rownum is
a pseudo column which is generated for query data set at runtime.
8. http://itntechnicalinterview.blogspot.com
http://itntechnicalinterview.blogspot.com
The difference between ROWNUM and ROWID is that ROWNUM is temporary while ROWID is
permanent. Another difference is that ROWID can be used to fetch a row, while ROWNUM only has
meaning within the context of a single SQL statement, a way of referencing rows within a fetched result
set.
16. What are different Types of Join?
1. Cross Join A cross join that does not have a WHERE clause produces the Cartesian product of the
tables involved in the join. The size of a Cartesian product result set is the number of rows in the
first table multiplied by the number of rows in the second table. The common example is when
company wants to combine each product with a pricing table to analyze each product at each
price.
2. Inner Join A join that displays only the rows that have a match in both joined tables is known as
inner Join. This is the default type of join in the Query and View Designer.
3. Outer Join A join that includes rows even if they do not have related rows in the joined table is
an Outer Join. You can create three different outer join to specify the unmatched rows to be
included:
1. Left Outer Join: In Left Outer Join all rows in the first-named table i.e. "left" table, which
appears leftmost in the JOIN clause are included. Unmatched rows in the right table do
not appear.
2. Right Outer Join: In Right Outer Join all rows in the second-named table i.e. "right"
table, which appears rightmost in the JOIN clause are included. Unmatched rows in the
left table are not included.
3. Full Outer Join: In Full Outer Join all rows in all joined tables are included, whether they
are matched or not.
4. Self Join This is a particular case when one table joins to itself, with one or two aliases to avoid
confusion. A self join can be of any type, as long as the joined tables are the same. A self join is
rather unique in that it involves a relationship with only one table. The common example is
when company has a hierarchal reporting structure whereby one member of staff reports to
another. Self Join can be Outer Join or Inner Join.
PL/SQL
12. What is Cursor?
Cursor is a database object used by applications to manipulate data in a set on a row-by- row basis,
instead of the typical SQL commands that operate on all the rows in the set at one time.
In order to work with a cursor we need to perform some steps in the following order:
1. Declare cursor
2. Open cursor
3. Fetch row from the cursor
4. Process fetched row
5. Close cursor
9. http://itntechnicalinterview.blogspot.com
http://itntechnicalinterview.blogspot.com
6. Deallocate cursor
What is a Trigger?
Triggers are special kind of stored procedures that get executed automatically when an INSERT, UPDATE
or DELETE operation takes place on a table. Triggers can’t be invoked on demand. They get triggered
only when an associated action (INSERT, UPDATE, and DELETE) happens on the table on which they are
defined. Triggers are generally used to implement business rules, auditing. Triggers can also be used to
extend the referential integrity checks, but wherever possible, use constraints for this purpose, instead
of triggers, as constraints are much faster.
What is De-normalization?
As the name indicates, de-normalization is the reverse process of normalization. It’s the controlled
introduction of redundancy in to the database design.
It helps improve the query performance as the number of joins could be reduced.
What is a Stored Procedure?
Stored Procedure is a group of sql statements that has been created once and stored in server database.
Stored procedures will accept input parameters so that single stored procedure can be used over
network by multiple clients using different input data. Stored procedures will reduce network traffic and
increase the performance.
Advantages
a) Stored procedure allows modular programming.
You can create the procedure once, store it in the database, and call it any number of times in your
program.
b) Stored Procedure allows faster execution.
If the operation requires a large amount of SQL code is performed repetitively, stored procedures can be
faster. They are parsed and optimized when they are first executed, and a compiled version of the
stored procedure remains in memory cache for later use. This means the stored procedure does not
need to be reparsed and reoptimized with each use resulting in much faster execution times.
c) Stored Procedure can reduce network traffic.
An operation requiring hundreds of lines of Transact-SQL code can be performed through a single
statement that executes the code in a procedure, rather than by sending hundreds of lines of code over
the network.
d) Stored procedures provide better security to your data