|
You may contact us by email: datawarehouse4u.info[at]gmail.com |
OLTP vs. OLAP
We can divide IT systems into transactional (OLTP) and analytical (OLAP). In general we can assume that OLTP systems provide source data to data warehouses, whereas OLAP systems help to analyze it. ![]() - OLTP (On-line Transaction Processing) is characterized by a large number of short on-line transactions (INSERT, UPDATE, DELETE). The main emphasis for OLTP systems is put on very fast query processing, maintaining data integrity in multi-access environments and an effectiveness measured by number of transactions per second. In OLTP database there is detailed and current data, and schema used to store transactional databases is the entity model (usually 3NF). - OLAP (On-line Analytical Processing) is characterized by relatively low volume of transactions. Queries are often very complex and involve aggregations. For OLAP systems a response time is an effectiveness measure. OLAP applications are widely used by Data Mining techniques. In OLAP database there is aggregated, historical data, stored in multi-dimensional schemas (usually star schema). The following table summarizes the major differences between OLTP and OLAP system design.
| ||||||||||||||||||||||||||||||||||
How to use CTE to remove duplicates --One use of Common table Expressions (CTEs) is to remove duplicates --To see this lets create a table 'Employee' CREATE table Employee ( name NVARCHAR ( 100 ) , age INT , salary INT ) --insert some duplicate data into the 'Employee Table'. INSERT into Employee VALUES ( 'Mark' , 42 , 120000 ) , ( 'Susan' , 29 , 125000 ) , ( 'Mark' , 42 , 120000 ) --you could see there is a duplicate record in the table by querying the table --select * from Employee --we could use CTE to remove this duplicate. WITH CTE_Employee ( name , age , salary , rownumber ) AS ( select name , age , salary , row_number ( ) OVER ( PARTITION BY name , age , salary ORDER BY name , age , salary ) AS rownumber from Employee ) DELETE FROM CTE_Employee WHERE rownumber <> 1 --query the table to see if there are still duplicates --select * f...


Comments
Post a Comment