My BI Stuff
Thursday, February 17, 2011
Wednesday, January 26, 2011
count distinct rows
with DateRowCount(col1,CountRows)
as
(
select col1,COUNT(col1)
over (partition by col1) from table1 as CountRows
)
select col1, CountRows
from DateRowCount
group by col1, CountRows
order by col1
as
(
select col1,COUNT(col1)
over (partition by col1) from table1 as CountRows
)
select col1, CountRows
from DateRowCount
group by col1, CountRows
order by col1
Update table from another table
UPDATE table1
SET
col1 = B.col1
, col2 = B.col2
, col3 = B.col3
from table2 B
where B.col4 = table1.col4 and B.col5 = table1.col5
and exists (select 1 from table2 where table2.account = table1.account and table2.memo_number = table1.memo_number )
SET
col1 = B.col1
, col2 = B.col2
, col3 = B.col3
from table2 B
where B.col4 = table1.col4 and B.col5 = table1.col5
and exists (select 1 from table2 where table2.account = table1.account and table2.memo_number = table1.memo_number )
Labels:
MS SQL,
MS SQL Issues,
SQL Server Performance Tuning
Wednesday, January 19, 2011
Delete Duplicate rows
WITH CTE (account,memo_number, DuplicateCount)
AS
(
SELECT account,memo_number, valdate,
ROW_NUMBER() OVER(PARTITION BY account,memo_number ORDER BY valdate desc) AS DuplicateCount
FROM inv1_transactions_bkp
)
DELETE
FROM CTE
WHERE DuplicateCount > 1
GO
AS
(
SELECT account,memo_number, valdate,
ROW_NUMBER() OVER(PARTITION BY account,memo_number ORDER BY valdate desc) AS DuplicateCount
FROM inv1_transactions_bkp
)
DELETE
FROM CTE
WHERE DuplicateCount > 1
GO
Wednesday, December 22, 2010
Interview Questions
Question
Article I. Previous Projects
What was your last project?
Explain the business side of the project?
What was your exact role?
What was the size of the database?
Who was your manager?
Who did you worked with?
What the largest table? How many rows?
Give me some examples of the database tables?
Was there any external source for files?
Article II. Informatica
Section 2.01 Objects
What is the use of joiner transformation?
How to use sorted port?
What is passive and active transformation?
Why do we override mapping SQL?
How to get a previous row in an informatica mapping?
What is pre session and post session database and OS level options?
How do I
Section 2.02 Example of mapping
Give me an example of most complex mapping you have done? Why was it complex?
Explain to me how a type II dimension can be implemented?
Section 2.03 Exception handling
Section 2.04 Re-run
Section 2.05 Performance tuning
Article III. Data Modeling
What is a dimension?
What is a fact?
Are dimensions normalized?
What is a slowing changing, type II dimension?
Article IV. SQL
What is an outer join?
Does oracle support full outer join?
How to find duplicate rows in a table?
There is a table will addresses of employees. There can be more than one address for the same employee. How do I get the latest address?
What is connect by clause?
Article V. Oracle
Section 5.01 Objects
What is the difference between procedures, packages and functions?
What are inline views?
What are materialized views?
How to incrementally refresh a materialized view?
What are the types of indexes?
What is difference between bitmap and B-tree index?
What are the types of cursors?
Give me an example where ref cursor is used?
Why do we need cursors?
What is Auth id clause?
What is commit point?
What is a exception block?
While updating a table; how do you know, how many rows have been updated?
Section 5.02 Tables
What are PCT free and PCT used?
What is te difference between time stamp and date?
Section 5.03 SQLLDR
Give me all the options for SQLLDR?
What is training space option?
Can you uses function in SQLLDR?
Can you use functions in SQLLDR?
How do process the bad records?
What is the difference between bad and rejected files?
How do you skip records?
How do yo skip the 1st few records?
Section 5.04 Performance Tuning
When do you use bit map index?
What is gather statistics vs. DBMS_STATS?
How to use show plan?
A query is running slow; what will you do to make is perform faster?
Article VI. Shell Script
What is .profile file?
How to remove header row?
How to remove a specific row from file?
How to count rows?
How to sum a specific column in a file?
How to write a shell script to ftp a file?
How to write a shell script to call a oracle procedure?
How to write a script a to call SQLLDR?
Article VII. Testing
How did you do Unit testing?
How dd you compare rows between two different databases?
Article VIII. Oracle interview
- INDEX
- What is an index?
- What types of indexes exists in oracle?
- What is a bitmap index?
- When do you use bitmap index?
- Partitioned Tables and Indexes in Oracle 9i
- Hash Partitioned Global Indexes Oracle 10g
- Partitioned Tables and Indexes in Oracle 10g
- What are IOT?
- What are function index ? how do they work?
- JOINS
- What king of joins exists?
- What is an equi join?
- What is an inner join?
- What is a outer join? When do you use it? Give an example?
- PACKAGES
- What’s the difference between procedures, packages & functions?
- When do you use packages?
- What is author id clause?
- Oracle database
- What is a tablespace?
- What is block?
- What is transportable tablespaces
- What is a rollback segment?
- What are the various memory components in Oracle?
- Explain the physical architecture of oracle?
- TABLES
- What is pct free/ pct used
- How do u set pct free pct used for a table?
- What is partitioning?
- What type of partitioning is present in oracle?
- What is
- TUNING
- Define the how will you tune an sql statement data is performing badly?
- Step 1
- Step 2
- Step 3
- Step 4
- What is analyzing table?
- What is the type of optimizers?
- How do optimize star schema?
- How do u use explain plan?
- SQL
- How do you find duplicates in a table?
- How do you filter a data in a group by query?
- PLSQL
- What is cursor? When do you use a cursor? What type of cursors exists? What are the differences and when each of them is used?
- What are built in packages?
- How do you write to a file from oracle?
- What is PLSQL block?
- How do you do exception handling? What is error propagation?
- What is %ROWTYPE, %TYPE
- What is a pragama ?
- What is ref cursor?
- What is dynamic PLSQL
- SECURITY
- How do you implement row level security in oracle?
10.
- What is a control file in SQL Loader?
- What are synonyms?
- What is data pump?
11. ORACLE other objects
- What are materialized views?
- How are materialized views used?
- What are the materialized views refresh strategy?
- What are IOT?
- What are oracle streams?
Article IX. ETL interview
- What is ETL?
- How may etl resource have you managed?
- Discuss UR etl strategy?
- Discuss all steps, analysis, mapping document, design document , development, testing, migration, & performance tuning strategies for ETL?
- How do you distribute work?
- What is migration worthy ETL?
- Discuss automation of ETL?
- What is the biggest load you have managed?
- How do you manage files?
- How do you populate a type II dimensions?
- Explain the most difficult etl process
- How do you do reconciliation?
- How do u manage exceptions?
- What kind of etl exceptions exists? How are they managed?
- What is error handling?
- What is data quality?
- how do assure data quality in etl process?
Article X. Data Warehousing interview
- What is data warehouse?
- Consolidation- Many systems/Subject areas/Location
- Integration
- Historical Store
- Aggregation
- What’s the difference between ODS/DWH & data mart?
- What is R Kimball strategy vs Bill Inmon strategy?
- What strategy do you prefer? Why? When?
Article XI. Data Modeling interview
- What is data model?
- What is 1st normal form..2nd..3rd…
- What’s the difference between logical & physical model?
- What is Star schema, Snowflake schema, and 3nf modeling?
- How does many to many relationship implemented in Modeling?
- What notations are used for modeling?
- What IS Type I & type II dim?
- What is fact?
- What is a dim?
- What is a fact less fact?
- What is a non-aggregate fact?
- What is snapshot fact?
- Have you done data modeling?
- What is the difference between OLTP data model & OLAP data model?
Article XII. Informatica Interview
Article XIII. Unix interview
Ksh
Awk
Sed
How do u get success & failure of Script
How can U 2 run process in parallel?
`
Article XIV. Reporting & OALP interview
Have you done reporting?
What kind of tools have you used?
What’s the difference between Reporting & olap?
Whats OLAP? ROLAP?MOLAP?HOLAP?
Name some tools on MOLAP & ROLAP?
Article XV. General interview Questions
Tell me about yourself?
I have 10 year so experience in IT
90% of the time I have worked on Informatica.
My recent experience has been on Informatica.
I will start with my recent experience.
Tell about the current project
Talk about UR Role in Previous Project
Ask him if he wants details…
Project about
Role
How many people managing?
Tech aspects
I will like to come and give a personal interview.
Tuesday, June 15, 2010
Difference between OLTP and OLAP
OLTP
Current data
Short database transactions
Online update/insert/delete
Normalization is promoted
High volume transactions
Transaction recovery is necessary
OLAP
Current and historical data
Long database transactions
Batch update/insert/delete
Denormalization is promoted
Low volume transactions
Transaction recovery is not necessary
Current data
Short database transactions
Online update/insert/delete
Normalization is promoted
High volume transactions
Transaction recovery is necessary
OLAP
Current and historical data
Long database transactions
Batch update/insert/delete
Denormalization is promoted
Low volume transactions
Transaction recovery is not necessary
Sunday, June 13, 2010
Subscribe to:
Posts (Atom)