Found 623 Articles for Data Storage

Difference Between ROLAP and MOLAP

AmitDiwan
Updated on 15-Apr-2021 07:43:12

1K+ Views

In this post, we will understand the difference between ROLAP and MOLAP.ROLAPIt stands for Relational Online Analytical Processing.It is used for large volumes of data.The access time in ROLAP is slow.It stores data in the form of relation tables.The data in ROLAP is fetched from a data warehouse.It uses complex SQL queries.A static multidimensional view of the data is created in ROLAP.MOLAPIt stands for Multidimensional Online Analytical Processing.It is used for less/limited volumes of data.The access time is quick in MOLAP.Data is stored in a multidimensional array.Data is fetched from the MDDBs database.A sparse matrix is used in MOLAP.Dynamic multidimensional ... Read More

Difference Between View and Materialized View

AmitDiwan
Updated on 15-Apr-2021 07:37:31

1K+ Views

In this post, we will understand the difference between a view and a materialized view.ViewsIt is a logical and virtual copy of a table that is created by executing a ‘select query’ statement.This result isn’t stored anywhere on the disk.Hence, every time, a query needs to be executed when certain data is needed.This way, the most recently updated data would be available from the tables.The tuple/result of the query doesn’t get stored.Instead, the query expression is stored on the disk.The query expression is stored, due to which the last updated data is obtained.They don’t have a storage/update cost associated with ... Read More

Difference Between Data Warehouse and Data Mart

Kiran Kumar Panigrahi
Updated on 20-Dec-2022 12:42:01

617 Views

Both data warehouses and data marts serve the same purpose; they are data repositories. However, we can differentiate a data warehouse from a data mart on the basis of the amount of data they can store. A data warehouse a large repository of data that is collected from different organizations, whereas a data mart is a logical subset of a data warehouse. Read this article to find out more about data warehouses and data marts and how they are different from each other. Let's start with a basic overview of the two. What is a Data Warehouse? Data Warehouse is ... Read More

Difference Between T-SQL and PL-SQL

AmitDiwan
Updated on 25-Mar-2021 06:05:23

1K+ Views

In this post, we will understand the difference between T-SQL and PL-SQL.T-SQLIt is a Microsoft product.It is known as Transact Structure Query language.It gives a high degree of control to the developers/programmers.It works its best, and provides good performance with Microsoft SQL server.It is easy.It is simple to understand.It allows the insertion of multiple rows into a table.This is done with the help of the ‘BULK INSERT’ statement.The ‘SELECT INTO’ statement is used in T-SQLIn this, the ‘NOT EXISTS’ clause can be used with the ‘SELECT’ statements.PL-SQLIt is an Oracle product.It is known as Procedural Language Structural Query Language.It is ... Read More

Difference Between Clustered and Non-clustered index

AmitDiwan
Updated on 25-Mar-2021 05:49:21

470 Views

In this post, we will understand the difference between clustered index and non-clustered index.Clustered indexIt is quick.It requires less memory to perform operations.The index is the main data.A table can have one clustered index only.It has inherent ability to store data on the disk.It can store pointers to block not to data.The leaf nodes contain actual data.The clustered key defines the order of data within table.It is a type of index where the table records are physically reordered to match with the index.Non-clustered indexIt is slower.It requires more memory to perform operations.The index is a copy of data.A table can ... Read More

Difference Between Grant and Revoke

AmitDiwan
Updated on 25-Mar-2021 05:46:44

3K+ Views

In this post, we will understand the difference between grant and revoke.GrantIt is a DCL command.It grants permissions to users on database objects.It can also be used to assign access rights to users.For every user, the permissions need to be specified.When the access is decentralized, permission granting is easier.Syntax:grant privilege_name on object_name to {user_name | public | role_name}RevokeIt is a DCL command.It removes permissions if they are granted to users on database objects.It takes away/revokes the rights of the users.If access for a user is removed, all specific permissions provided by that user to others will be removed.If decentralized access ... Read More

Create Primary Key on an existing table in PostgreSQL?

Yash Sanghvi
Updated on 02-Feb-2021 13:09:44

2K+ Views

Although quite infrequent, you may come across situations wherein you need to define the primary key on an existing table. This can be achieved using the ALTER TABLE statement.The syntax is −ALTER TABLE table_name ADD PRIMARY KEY (column_name1, column_name2, …., columns_nameN)As can be seen from the above syntax, you can define PRIMARY KEY on multiple columns. When you have defined the PRIMARY KEY on multiple columns, the condition is that the column pairs should have unique and non-null values. Thus, if the PRIMARY KEY is defined on (column1, column2), the values (value1, value2), (value3, value2), and (value1, value4) are allowed. ... Read More

Extract day, hour, minute, etc. from a datetime column in PostgreSQL?

Yash Sanghvi
Updated on 02-Feb-2021 13:08:17

969 Views

Let us create a new table containing a single timestamp column −CREATE TABLE timestamp_test(    ts timestamp );Now let us populate it with some data −INSERT INTO timestamp_test(ts) VALUES(current_timestamp), (current_timestamp+interval '5 days'), (current_timestamp-interval '18 hours'), (current_timestamp+interval '1 year'), (current_timestamp+interval '3 minutes'), (current_timestamp-interval '6 years');If you query the table (SELECT * from timestamp_test), you will see the following output −ts2021-01-30 19:23:24.0080872021-02-04 19:23:24.0080872021-01-30 01:23:24.0080872022-01-30 19:23:24.0080872021-01-30 19:26:24.0080872015-01-30 19:23:24.008087Now, in order to extract hour, minute, etc. from the timestamp column, we use the EXTRACT function. Some examples are shown below −SELECT EXTRACT(HOUR from ts) as hour from timestamp_testOutput −hour19191191919Similarly −SELECT EXTRACT(MONTH from ts) as ... Read More

Aliasing in PostgreSQL?

Yash Sanghvi
Updated on 02-Feb-2021 13:05:41

162 Views

Often, we have some very long table names, and writing the table name every time is troublesome. We can use aliasing to help us there, thanks to which, we will need to write the long table name only once.The table aliases are generally written in the FROM part of the statement, or the JOIN part.For example, consider that we have two tables, marks, and student_info, defined respectively below −marksnameroll_noperc_marksAniket1224Siddhi4565Yash2642Isha5687student_infonameroll_noagegenderAniket1226MIsha5625FSiddhi4523FYash2625MNow, if you want to see the name, roll_no, perc_marks, and age of the student in one query, your query will look like this −SELECT marks.name, marks.roll_no, marks.perc_marks, student_info.age FROM marks LEFT ... Read More

How to combine different columns of a table to yield a single column in query output in PostgreSQL?

Yash Sanghvi
Updated on 02-Feb-2021 13:02:48

1K+ Views

Suppose you have a table user_info that contains the state and district of different users. An example is given below −namedistrictstateAnilMumbaiMaharashtraJoyJhalawarRajasthanRonPuneMaharashtraReenaMeerutUttar PradeshNow, if you want to combine the state and district in a single field called location, this is how you should be able to do it −SELECT name, district || ', ' || state as location from user_infoThe || operator is the string concatenation operator. The output will be −namelocationAnilMumbai, MaharashtraJoyJhalawar, RajasthanRonPune, MaharashtraReenaMeerut, Uttar PradeshSimilar operations can also be performed on numerical values. Suppose you have a table marks containing the total marks scored by students and the maximum ... Read More

Advertisements