Vous êtes sur la page 1sur 15

Q) i have emp table in which columns are empid,empname,sal now i want to increase the sal

of the particular emp whose sal is <10000 with 2000RS & sal >10000 & <20000 with
4000RS and whose sal is >20000 with 5000RS now write a single update query.

UPDATE Emp
SET sal = sal +
CASE
WHEN sal>=1000 AND sal<2000 THEN 200
WHEN sal>=2000 AND sal<3000 THEN 300
END;

1. The following query retrieves "2" highest paid employees FROM each
Department :

SELECT deptno, empno, sal


FROM emp e
WHERE
2 > ( SELECT COUNT(e1.sal)
FROM emp e1
WHERE e.deptno = e1.deptno AND e.sal < e1.sal )
ORDER BY 1,3 DESC;

2. Query that will display the total no. of employees, and of that total the
number who were hired in 1980, 1981, 1982, and 1983. Give appropriate
column headings.

I am looking at the following output. We need to stick to this format.

Total 1980 1981 1982 1983


----------- ------------ ------------ ------------- -----------
14 1 10 2 1

SELECT COUNT (*), COUNT(DECODE(TO_CHAR (hiredate, 'YYYY'),'1980', empno))


"1980",
COUNT (DECODE (TO_CHAR (hiredate, 'YYYY'), '1981', empno))
"1981",
COUNT (DECODE (TO_CHAR (hiredate, 'YYYY'), '1982', empno))
"1982",
COUNT (DECODE (TO_CHAR (hiredate, 'YYYY'), '1983', empno))
"1983"
FROM emp;

3. Query for listing Deptno, ename, sal, SUM(sal in that dept) :

SELECT a.deptno, ename, sal, (SELECT SUM(sal) FROM emp b WHERE a.deptno =
b.deptno)
FROM emp a
ORDER BY a.deptno;

OUTPUT :
=======
DEPTNO ENAME SAL SUM (SAL)
========= ======= ==== =========
10 KING 5000 11725
30 BLAKE 2850 10900
10 CLARK 2450 11725
10 JONES 2975 11725
30 MARTIN 1250 10900
30 ALLEN 1600 10900
30 TURNER 1500 10900
30 JAMES 950 10900
30 WARD 2750 10900
20 SMITH 8000 33000
20 SCOTT 3000 33000
20 MILLER 20000 33000

4. Create a matrix query to display the job, the salary for that job based on
department number, and the total salary for that job for all departments,
giving each column an appropriate heading.

The output is as follows - we need to stick to this format :

Job Dept 10 Dept 20 Dept


30 Total
---------- --------------- ------------- -------------
---------
ANALYST 6000
6000
CLERK 1300 1900 950
4150
MANAGER 2450 2975 2850
8275
PRESIDENT 5000
5000
SALESMAN 5600
5600

SELECT job "Job", SUM (DECODE (deptno, 10, sal)) "Dept 10",
SUM (DECODE (deptno, 20, sal)) "Dept 20",
SUM (DECODE (deptno, 30, sal)) "Dept 30",
SUM (sal) "Total"
FROM emp
GROUP BY job ;

5. 4th Top Salary of all the employees:

SELECT DEPTNO, ENAME, SAL


FROM EMP A
WHERE
3 = (SELECT COUNT(B.SAL) FROM EMP B
WHERE A.SAL < B.SAL) ORDER BY SAL DESC;

6. Retrieving the 5th row FROM a table:

SELECT DEPTNO, ENAME, SAL


FROM EMP
WHERE ROWID = (SELECT ROWID FROM EMP WHERE ROWNUM <= 5
MINUS
SELECT ROWID FROM EMP WHERE ROWNUM < 5)

7. Tree Query :

Name Null? Type


-------------------------------------------------------------------
SUB NOT NULL VARCHAR2(4)
SUPER VARCHAR2(4)
PRICE NUMBER(6,2)

SELECT sub, super


FROM parts
CONNECT BY PRIOR sub = super
START WITH sub = 'p1';

8. Eliminate duplicates rows in a table :

DELETE FROM table_name A


WHERE ROWID > ( SELECT min(ROWID) FROM table_name B WHERE A.col =
B.col);

9. Displaying EVERY 4th row in a table : (If a table has 14 rows, 4,8,12 rows
will be selected)

SELECT *
FROM emp
WHERE (ROWID,0) IN (SELECT ROWID, MOD(ROWNUM,4)
FROM emp);
10. Top N rows FROM a table : (Displays top 9 salaried people)

SELECT ename, deptno, sal


FROM (SELECT * FROM emp ORDER BY sal DESC)
WHERE ROWNUM < 10;

11. How does one count/sum RANGES of data values in a column? A value x
will be between values y and z if GREATEST(x, y) = LEAST(x, z).

SELECT
f2,
COUNT(DECODE(greatest(f1,59), least(f1,100), 1, 0)) "Range 60-100",
COUNT(DECODE(greatest(f1,30), least(f1, 59), 1, 0)) "Range 30-59",
COUNT(DECODE(greatest(f1,29), least(f1, 0), 1, 0)) "Range 00-29"
FROM my_table
GROUP BY f2;

12. For equal size ranges it migth be easier to calculate it with


DECODE(TRUNC(value/range), 0, rate_0, 1, rate_1, ...).

SELECT ename "Name", sal "Salary",


DECODE( TRUNC(sal/1000, 0), 0, 0.0,
1, 0.1,
2, 0.2,
3, 0.3) "Tax rate"
FROM emp;

13. How does one count different data values in a column?

COL NAME DATATYPE


----------------------------------------
DNO NUMBER
SEX CHAR

SELECT dno, SUM(DECODE(sex,'M',1,0)) MALE,


SUM(DECODE(sex,'F',1,0)) FEMALE,
COUNT(DECODE(sex,'M',1,'F',1)) TOTAL
FROM t1
GROUP BY dno;

14. Query to get the product of all the values of a column :

SELECT EXP(SUM(LN(col1))) FROM srinu;

15. Query to display only the duplicate records in a table:

SELECT num
FROM satyam
GROUP BY num
HAVING COUNT(*) > 1;

16. Query for getting the following output as many number of rows in the
table :

*
**
***
****
*****

SELECT RPAD(DECODE(temp,temp,'*'),ROWNUM,'*')
FROM srinu1;

17. Function for getting the Balance Value :

FUNCTION F_BALANCE_VALUE
(p_business_group_id number, p_payroll_action_id number,
p_balance_name varchar2, p_dimension_name varchar2) RETURN NUMBER
IS
l_bal number;
l_defined_bal_id number;
l_assignment_action_id number;
BEGIN
SELECT assignment_action_id
INTO l_assignment_action_id
FROM
pay_assignment_actions
WHERE
assignment_id = :p_assignment_id
AND payroll_action_id = p_payroll_action_id;

SELECT
defined_balance_id
INTO
l_defined_bal_id
FROM
pay_balance_types pbt,
pay_defined_balances pdb,
pay_balance_dimensions pbd
WHERE
pbt.business_group_id = p_business_group_id
AND UPPER(pbt.balance_name) = UPPER(p_balance_name)
AND pbt.business_group_id = pdb.business_group_id
AND pbt.balance_type_id = pdb.balance_type_id
AND UPPER(pbd.dimension_name) = UPPER(p_dimension_name)
AND pdb.balance_dimension_id = pbd.balance_dimension_id;

l_bal := pay_balance_pkg.get_value(l_defined_bal_id,l_assignment_action_id);

RETURN (l_bal);

exception
WHEN no_data_found THEN
RETURN 0;
END;

18. Function for getting the Element Value :

FUNCTION f_element_value(
p_classification_name in varchar2,
p_element_name in varchar2,
p_business_group_id in number,
p_input_value_name in varchar2,
p_payroll_action_id in number,
p_assignment_id in number
)
RETURN number
IS
l_element_value number(14,2) default 0;
l_input_value_id pay_input_values_f.input_value_id%type;
l_element_type_id pay_element_types_f.element_type_id%type;
BEGIN
SELECT DISTINCT element_type_id
INTO l_element_type_id
FROM pay_element_types_f pet,
pay_element_classifications pec
WHERE pet.classification_id = pec.classification_id
AND upper(classification_name) = upper(p_classification_name)
AND upper(element_name) = upper(p_element_name)
AND pet.business_group_id = p_business_group_id;
SELECT input_value_id
INTO l_input_value_id
FROM pay_input_values_f
WHERE upper(name) = upper(p_input_value_name)
AND element_type_id = l_element_type_id;

SELECT NVL(prrv.result_value,0)
INTO l_element_value
FROM pay_run_result_values prrv,
pay_run_results prr,
pay_assignment_actions paa
WHERE prrv.run_result_id = prr.run_result_id
AND prr.assignment_ACTION_ID = paa.assignment_action_id
AND paa.assignment_id = p_assignment_id
AND input_value_id = l_input_value_id
AND paa.payroll_action_id = p_payroll_action_id;

RETURN (l_element_value);

exception
WHEN no_data_found THEN
RETURN 0;
END;

19. SELECT Query for counting No of words :

SELECT ename,
NVL(LENGTH(REPLACE(TRANSLATE(UPPER(RTRIM(ename)),'ABCDEFGHIJKLMNO
PQRSTUVWXYZ'' ',' @'),' ',''))+1,1) word_length
FROM emp;

Explanation :

TRANSLATE(UPPER(RTRIM(ename)),'ABCDEFGHIJKLMNOPQRSTUVWXYZ''
',' @') -- This will translate all the characters FROM A-
Z including a single quote to a space. It will also translate a space to a @.

REPLACE(TRANSLATE(UPPER(RTRIM(ename)),'ABCDEFGHIJKLMNOPQRSTUVWX
YZ'' ',' @'),' ','') -- This will replace every space with nothing in the
above result.

LENGTH(REPLACE(TRANSLATE(UPPER(RTRIM(ename)),'ABCDEFGHIJKLMNOPQR
STUVWXYZ'' ',' @'),' ',''))+1 -- This will give u the count
of @ characters in the above result.

20. Function to check for a leap year :

CREATE OR REPLACE FUNCTION is_leap_year (p_date IN DATE) RETURN


VARCHAR2
AS
v_test DATE;
BEGIN
v_test := TO_DATE ('29-Feb-' || TO_CHAR (p_date,'YYYY'),'DD-Mon-YYYY');
RETURN 'Y';
EXCEPTION
WHEN OTHERS THEN
RETURN 'N';
END is_leap_year;

SQL> SELECT hiredate, TO_CHAR (hiredate, 'Day') weekday


FROM emp
WHERE is_leap_year (hiredate) = 'Y';

SQL Interview Questions & Answers


Also read => All about Database Testing
Q#1. What does SQL stand for?
Ans. SQL stands for Structured Query Language.
Q#2. How to select all records from the table?
Ans. To select all the records from the table we need to use following syntax:
Select * from table_name;

Q#3. Define join and name different type of joins?


Ans. Join keyword is used to fetch data from related two or more tables. It returns rows
where there is at least one match in both the tables included in join. Read more here.
Type of joins are-
1. Right Join
2. Outer Join
3. Full Join
4. Cross Join
5. Self Join.
Q#4. What is the syntax to add record to a table?
Ans. To add record in a table INSERT syntax is used.
Ex: INSERT into table_name VALUES (value1, value2..);

Q#5. How do you add a column to a table?


Ans. To add another column in the table following command has been used.
ALTER TABLE table_name ADD (column_name);

Q#6. Define SQL Delete statement.


Ans. Delete is used to delete a row or rows from a table based on the specified
condition.
Basic syntax is as follows:
DELETE FROM table_name

WHERE <Condition>

Q#7. Define COMMIT ?


Ans. COMMIT saves all changes made by DML statements.
Q#8. What is a primary key?
Ans. A Primary key is column whose values uniquely identify every row in a table.
Primary key values can never be reused.
Q#9. What are foreign keys?
Ans. When a one tables primary key field is added to related tables in order to create
the common field which relates the two tables, it called a foreign key in other tables.
Foreign Key constraints enforce referential integrity.
Q#10. What is CHECK Constraint?
Ans. A CHECK constraint is used to limit the values or type of data that can be stored in
a column. They are used to enforce domain integrity.
Q#11. Is it possible for a table to have more than one foreign key?
Ans. Yes, a table can have many foreign keys and only one primary key.
Q#12. What are the possible values for BOOLEAN data field.
Ans. For a BOOLEAN data field two values are possible: -1(true) and 0(false).
Q#13. What is a stored procedure?
Ans. A stored procedure is a set of SQL queries which can take input and send back
output.
Q#14. What is identity in SQL?
Ans. An identity column in the SQL automatically generates numeric values. We can
defined a start and increment value of identity column.
Q#15. What is Normalization?
Ans. The process of table design to minimize the data redundancy is called
normalization. We need to divide a database into two or more table and define
relationships between them.
Q#16. What is Trigger?
Ans. Trigger allows us to execute a batch of SQL code when a table event occurs
(Insert, update or delete command executed against a specific table)
Q#17. How to select random rows from a table?
Ans. Using SAMPLE clause we can select random rows.
Example:
SELECT * FROM table_name SAMPLE(10);
Q#18. Which TCP/IP port does SQL Server run?
Ans. By default SQL Server runs on port 1433.
Q#19. Write a SQL SELECT query that only returns each name only once from a
table?
Ans. To get the each name only once, we need to use the DISTINCT keyword.
SELECT DISTINCT name FROM table_name;

Q#20. Explain DML and DDL?


Ans. DML stands for Data Manipulation Language. INSERT, UPDATE and DELETE are
DML statements.
DDL stands for Data Definition Language. CREATE ,ALTER, DROP, RENAME are DDL
statements.

Q#21. Can we rename a column in the output of SQL query?


Ans. Yes using the following syntax we can do this.
SELECT column_name AS new_name FROM table_name;

Q#22. Give the order of SQL SELECT ?


Ans. Order of SQL SELECT clauses is: SELECT, FROM, WHERE, GROUP BY, HAVING,
ORDER BY. Only the SELECT and FROM clause are mandatory.
Q#23. Suppose a Student column has two columns, Name and Marks. How to
get name and marks of top three students.
Ans. SELECT Name, Marks FROM Student s1 where 3 <= (SELECT COUNT(*) FROM
Students s2 WHERE s1.marks = s2.marks)
Q#24. What is SQL comments?
Ans. SQL comments can be put by two consecutive hyphens ().
Q#25. Difference between TRUNCATE, DELETE and DROP commands?
Ans. DELETE removes some or all rows from a table based on the condition. It can be
rolled back.
------------
TRUNCATE removes ALL rows from a table by de-allocating the memory pages. The
operation cannot be rolled back

DROP command removes a table from the database completely.

Q#26. What are the properties of a transaction?


Ans. Generally these properties are referred as ACID properties. They are:
1. Atomicity
2. Consistency
3. Isolation
4. Durability.
Q#27. What do you mean by ROWID ?
Ans. Its a 18 character long pseudo column attached with each row of a table.
Q#28. Define UNION, MINUS, UNION ALL, INTERSECT ?
Ans. MINUS returns all distinct rows selected by the first query but not by the second.
UNION returns all distinct rows selected by either query

UNION ALL returns all rows selected by either query, including all duplicates.

INTERSECT returns all distinct rows selected by both queries.

Q#29. What is a transaction?


Ans. A transaction is a sequence of code that runs against a database. It takes database
from one consistent state to another.
Q#30. What is difference between UNIQUE and PRIMARY KEY constraints?
Ans. A table can have only one PRIMARY KEY whereas there can be any number of
UNIQUE keys.
Primary key cannot contain Null values whereas Unique key can contain Null values.

Q#31. What is a composite primary key?


Ans. Primary key created on more than one column is called composite primary key.
Q#32. What is an Index ?
Ans. An Index is an special structure associated with a table speed up the performance
of queries. Index can be created on one or more columns of a table.
Q#33. What is the Subquery ?
Ans. A Subquery is sub set of select statements whose return values are used in filtering
conditions of the main query.
Q#34. What do you mean by query optimization?
Ans. Query optimization is a process in which database system compares different query
strategies and select the query with the least cost.
Q#35. What is Collation?
Ans. Set of rules that defines how data is stored, how case sensitivity and Kana
character can be treated etc.
Q#36. What is Referential Integrity?
Ans. Set of rules that restrict the values of one or more columns of the tables based on
the values of primary key or unique key of the referenced table.
Q#37. What is Case Function?
Ans. Case facilitates if-then-else type of logic in SQL. It evaluates a list of conditions and
returns one of multiple possible result expressions.
Q#38. Define a temp table?
Ans. A temp table is a temporary storage structure to store the data temporarily.
Q#39. How we can avoid duplicating records in a query?
Ans. By using DISTINCT keyword duplicating records in a query can be avoided.
Q#40. Explain the difference between Rename and Alias?
Ans. Rename is a permanent name given to a table or column whereas Alias is a
temporary name given to a table or column.
Q#41. What is a View?
Ans. A view is a virtual table which contains data from one or more tables. Views restrict
data access of table by selecting only required values and make complex queries easy.
Q#42. What are the advantages of Views?
Ans. Advantages of Views:
1. Views restrict access to the data because the view can display selective columns
from the table.
2. Views can be used to make simple queries to retrieve the results of complicated
queries. For example, views can be used to query information from multiple
tables without the user knowing.
Q#43. List the various privileges that a user can grant to another user?
Ans. SELECT, CONNECT, RESOURCES.
Q#44. What is schema?
Ans. A schema is collection of database objects of a User.
Q#45. What is Table ?
Ans. A table is the basic unit of data storage in the database management system. Table
data is stored in rows and columns.
Q#46. Do View contain Data?
Ans. No, Views are virtual structure.
Q#47. Can a View based on another View?
Ans. Yes, A View is based on another View.
Q#48. What is difference between Having clause and Where clause?
Ans. Both specify a search condition but Having clause is used only with the SELECT
statement and typically used with GROUP BY clause.
If GROUP BY clause is not used then Having behaves like WHERE clause only.
Q#49. What is difference between Local and Global temporary table?
Ans. If defined in inside a compound statement a local temporary table exists only for
the duration of that statement but a global temporary table exists permanently in the db
but its rows disappears when the connection is closed.
Q#50. What is CTE?
Ans. A CTE or common table expression is an expression which contains temporary
result set which is defined in a SQL statement.
Q. How do you select all records from the table?
Select * from table_name;

Q. What is a join?
Join is a process of retrieve pieces of data from different sets (tables) and returns them to the user or
program as one joined collection of data.

Q. How do you add record to a table?


A. INSERT into table_name VALUES (ALEX, 33 , M);

Q. How do you add a column to a table?


ALTER TABLE Department ADD (AGE, NUMBER);

Q. How do you change value of the field?


A. UPDATE EMP_table set number = 200 where item_munber = CD;
update name_table set status = 'enable' where phone = '4161112222';
update SERVICE_table set REQUEST_DATE = to_date ('2006-03-04 09:29', 'yyyy-mm-dd hh24:MM')
where phone = '4161112222';

Q. What does COMMIT do?


A. Saving all changes made by DML statements

Q. What is a primary key?


A. The column (columns) that has completely unique data throughout the table is known as the
primary key field.

Q. What are foreign keys?


A. Foreign key field is a field that links one table to another tables primary or foreign key.

Q. What is the main role of a primary key in a table?


A. The main role of a primary key in a data table is to maintain the internal integrity of a data table.

Q. Can a table have more than one foreign key defined?


A table can have any number of foreign keys defined. It can have only one primary key defined.

Q. List all the possible values that can be stored in a BOOLEAN data field.
There are only two values that can be stored in a BOOLEAN data field: -1(true) and 0(false).

Q. What is the highest value that can be stored in a BYTE data field?
A. The highest value that can be stored in a BYTE field is 255. or from -128 to 127. Byte is a set of
Bits that represent a single character. Usually there are 8 Bits in a Byte, sometimes more, depending
on how the measurement is being made. Each Char requires one byte of memory and can have a
value from 0 to 255 (or 0 to 11111111 in binary).

Q. Describe how NULLs work in SQL?


The NULL is how SQL handles missing values. Arithmetic operation with NULL in SQL will return a
NULL.

Q. What is Normalization?
A. The process of table design is called normalization.

Q. What is Trigger?
A. Trigger will execute a block of procedural code against the database when a table event occurs.
A2. A trigger defines a set of actions that are performed in response to an insert, update, or delete
operation on a specified table. When such an SQL operation is executed, in this case the trigger has
been activated.

Q. Can one select a random collection of rows from a table?


Yes. Using SAMPLE clause. Example:
SELECT * FROM EMPLOYEES SAMPLE(10);
10% of rows selected randomly will be returned.

Q. You issue the following query:


SELECT FirstName FROM StaffListWHERE FirstName LIKE '_A%
Which names would be returned by this query? Choose all that apply.
Allen
CLARK
JACKSON
David

Q. Write a SQL SELECT query that only returns each city only once from Students table? Do you
need to order this list with an ORDER BY clause?
A. SELECT DISTINCT City FROM Students;

Q. What is DML and DDL?


DML and DDL are subsets of SQL. DML stands for Data Manipulation Language and DDL Data
Definition Language.
DML consist of INSERT, UPDATE and DELETE
DDL commands
CREATE TABLE, ALTER TABLE, DROP TABLE, RENAME TABLE, CREATE INDEX, ALTER
INDEX, DROP INDEX.
CREATE/ALTER/DROP VIEW

Q. Write SQL SELECT query that returns the first and last name of each instructor, the Salary, and
gives each of them a number.
A. SELECT FirstName, LastName, Salary, ROWNUM FROM Instructors;

Q. Is the WHERE clause must appear always before the GROUP BY clause in SQL SELECT ?
A. Yes. The proper order for SQL SELECT clauses is: SELECT, FROM, WHERE, GROUP BY,
HAVING, ORDER BY. Only the SELECT and FROM clause are mandatory.

Q. Which of the following statements are Data Manipulation Language commands?


INSERT
UPDATE
GRANT
TRUNCATE
CREATE
Ans. A and B. The INSERT and UPDATE statements are Data Manipulation Language (DML)
commands. GRANT is a Data Control Language (DCL) command. TRUNCATE and CREATE are
Data Definition Language (DDL) commands

Question: Describe SQL comments.


A. SQL comments are introduced by two consecutive hyphens (--) and ended by the end of the line.
Q. Difference between TRUNCATE, DELETE and DROP commands?
A. The DELETE command is used to remove 'some or all rows from a table.
TRUNCATE removes ALL rows from a table. The operation cannot be rolled back
The DROP command removes a table from the database. All the tables' rows, indexes and privileges
will also be removed.

Question.1 What is a Data Warehouse?


Answer: A Data Warehouse is a collection of data marts representing historical data from
different operational data source (OLTP). The data from these OLTP are structured and
optimized for querying and data analysis in a Data Warehouse.
Question.2 What is a Data mart?
Answer: A Data Mart is a subset of a data warehouse that can provide data for reporting
and analysis on a section, unit or a department like Sales Dept, HR Dept, etc. The Data Mart
are sometimes also called as HPQS (Higher Performance Query Structure).[sociallocker]
Question.3 What is OLAP?
Answer: OLAP stands for Online Analytical Processing. It uses database tables (Fact and
Dimension tables) to enable multidimensional viewing, analysis and querying of large
amount of data.
Question.4 What is OLTP?
Answer: OLTP stands for Online Transaction Processing Except data warehouse databases
the other databases are OLTPs. These OLTP uses normalized schema structure. These OLTP
databases are designed for recording the daily operations and transactions of a business.
Question.5 What are Dimensions?
Answer: Dimensions are categories by which summarized data can be viewed. For example
a profit Fact table can be viewed by a time dimension.
Question.6 What are Confirmed Dimensions?
Answer: The Dimensions which are reusable and fixed in nature Example customer, time,
geography dimensions.
Question.7 What are Fact Tables?
Answer: A Fact Table is a table that contains summarized numerical (facts) and historical
data. This Fact Table has a foreign key-primary key relation with a dimension table. The Fact
Table maintains the information in 3rd normal form.
A star schema is defined is defined as a logical database design in which there will be
a centrally located fact table which is surrounded by at least one or more dimension tables.
This design is best suited for Data Warehouse or Data Mart.

Question.8 What are the types of Facts?


Answer: The types of Facts are as follows.
1. Additive Facts: A Fact which can be summed up for any of the dimension available in
the fact table.

2. Semi-Additive Facts: A Fact which can be summed up to a few dimensions and not for
all dimensions available in the fact table.

3. Non-Additive Fact: A Fact which cannot be summed up for any of the dimensions
available in the fact table.

Question.9 What are the types of Fact Tables?


Answer: The types of Fact Tables are:
1. Cumulative Fact Table: This type of fact tables generally describes what was happened
over the period of time. They contain additive facts.

2. Snapshot Fact Table: This type of fact table deals with the particular period of time.
They contain non-additive and semi-additive facts.

Question.10 What is Grain of Fact?


Answer: The Grain of Fact is defined as the level at which the fact information is stored in a
fact table. This is also called as Fact Granularity or Fact Event Level.
Question.11 What is Factless Fact table?
Answer: The Fact Table which does not contains facts is called as Fact Table. Generally
when we need to combine two data marts, then one data mart will have a fact less fact table
and other one with common fact table.
Question.12 What are Measures?
Answer: Measures are numeric data based on columns in a fact table.
Question.13 What are Cubes?
Answer: Cubes are data processing units composed of fact tables and dimensions from the
data warehouse. They provided multidimensional analysis.
Question.14 What are Virtual Cubes?
Answer: These are combination of one or more real cubes and require no disk space to
store them. They store only definition and not the data.
Question.15 What is a Star schema design?
Answer: A Star schema is defined as a logical database design in which there will be a
centrally located fact table which is surrounded by at least one or more dimension tables. This
design is best suited for Data Warehouse or Data Mart.
Question.16 What is Snow Flake schema Design?
Answer: In a Snow Flake design the dimension table (de-normalized table) will be further
divided into one or more dimensions (normalized tables) to organize the information in a
better structural format. To design snow flake we should first design star schema design.
Question.17 What is Operational Data Store [ODS] ?
Answer: It is a collection of integrated databases designed to support operational
monitoring. Unlike the OLTP databases, the data in the ODS are integrated, subject oriented
and enterprise wide data.
Question.18 What is Denormalization?
Answer: Denormalization means a table with multi duplicate key. The dimension table
follows Denormalization method with the technique of surrogate key.
Question.19 What is Surrogate Key?
Answer: A Surrogate Key is a sequence generated key which is assigned to be a primary
key in the system (table).[/signinlocker]

==================================================================================

Vous aimerez peut-être aussi