Found 623 Articles for Data Storage

How to add column to an existing table in PostgreSQL?

Yash Sanghvi
Updated on 02-Feb-2021 12:07:55

794 Views

The syntax to add a new column to an existing table is quite straightforward.ALTER TABLE table_name ADD COLUMN column_name column_type column_constraint;Say you have existing table marks. An example is given below −serial_nonameroll_nomarks_obtainedperc_marksmax_marksdate_of_entry1Yash2642421002021-01-302Isha5617587.52002021-01-30Now, suppose you want to add a column named subject. You can do that using −ALTER TABLE marks ADD COLUMN subject VARCHAR;Now if you query the table again using, SELECT * from marksYou will see the following output  −serial_nonameroll_nomarks_obtainedperc_ marksmax_ marksdate_ of_ entrysubject1Yash2642421002021-01-30[null]2Isha5617587.52002021-01-30[null]Note that the values in the subject column are null because we have just created the column, not populated it. We can populate it using the UPDATE ... Read More

How to create a table in PostgreSQL?

Yash Sanghvi
Updated on 02-Feb-2021 11:45:34

215 Views

Creating a table in PostgreSQL is pretty straightforward. The syntax is −CREATE TABLE table_name(    Column1_name type optional_constraint,    Column2_name type optional_constraint,    .    .    .    ColumnN_name type optional constraint );If you want to make sure that your table is created only if it doesn’t already exist, you can specify that explicitly −CREATE TABLE IF NOT EXISTS table_name(…);An example of table creation is given below −CREATE TABLE marks(    serial_no SERIAL PRIMARY KEY,    name VARCHAR,    roll_no INTEGER,    marks_obtained INTEGER,    perc_marks DOUBLE PRECISION,    max_marks INTEGER,    date_of_entry DATE );The above command will just ... Read More

How to Kill queries in pgAdmin in PostgreSQL?

Yash Sanghvi
Updated on 02-Feb-2021 11:41:24

4K+ Views

Sometimes, some rogue queries can take too long to execute. If the queries are blocking in nature, i.e., they restrict access to a table while they are executing, then any other query on the same table will be put on hold, and this leads to a pile-up of queries. This can, depending on your DB load, even cause the max connections to be exceeded. Luckily, you can easily kill long queries in pgAdmin.Go to Dashboard in your pgAdmin. At the bottom, in the Server Activity section, under the Sessions Tab, you can see all the Active queries.Now, notice the cross ... Read More

How to Query a DB in pgAdmin in PostgreSQL?

Yash Sanghvi
Updated on 02-Feb-2021 11:41:01

3K+ Views

Querying a DB in pgAdmin is quite straightforward. Locate your DB in the Servers dropdown on the left, and extend its dropdown, till you see the Schemas dropdown.Once you click on Schemas, the black button on the top, with the DB symbol and the play arrow will become clickable.Click on that button, and you will see a Query Tab open up. That’s it, you can type your queries for this particular DB in that box, and click the play arrow button to execute the queries.The output will be seen on the bottom, in the ‘Data Output’ section.Read More

Difference between Magnetic Tape and Magnetic Disk

Nitin Sharma
Updated on 09-Jun-2020 08:17:09

5K+ Views

Both Magnetic Tape and Magnetic Disk are the type of non-volatile magnetic memory and used to store the data. On the basis of architecture and features we can distinguish between both Magnetic Tape Memory and Magnetic Disk Memory. Following are the important differences between Magnetic Tape Memory and Magnetic Disk Memory.Sr. No.KeyMagnetic Tape MemoryMagnetic Disk Memory1DefinitionMagnetic tape is type of non-volatile memory uses thin plastic ribbon is used for storing data and as data use to be stored on ribbon so data read/write speed is slower due to which is mainly used for data backups.On other hand Magnetic Disk is ... Read More

Difference between Pipes and Message Queues

Mahesh Parahar
Updated on 16-Apr-2020 06:16:00

2K+ Views

Unix PipesUnix Pipes are used in inter-process communication. A pipe as name suggests provides a unidirectional flow of information. Data flows from one end to another.Message QueuesMessage queue allows to share messages by a sender process to another process (es). A message queue is implemented as a linked list of messages and stored within kernel. Each message has a unique message queue identifier. The kernel keeps a record of message queues present in the system.The following are some of the important differences between Unix Pipes and Message Queues.Sr. No.KeyPipeMessage Queue1ConceptThe pipe is the Unix IPC form to provide a flow ... Read More

Difference between Deep Web and Dark Web

Kiran Kumar Panigrahi
Updated on 22-Aug-2022 14:46:18

930 Views

When we surf the Internet, the webpages that we see and the contents that we download generally come from the "surface web". This is the part of the world wide web that is accessible to all with an Internet connection. The Surface Web is huge, but in reality, it covers only 10% of the whole Internet.Beside the Surface Web that is transparent and accessible to all, there are two more levels of the Internet that remain hidden in the background. These two are known as the Deep Web and the Dark Web.The deep web contains the web content that is ... Read More

Difference between Memory and Storage

Kiran Kumar Panigrahi
Updated on 11-Jan-2023 15:32:25

968 Views

Memory and Storage are two terms that are often used interchangeably, but they refer to different things. Memory is used to store data that is being actively used by the CPU, while Storage is used to store long-term data that needs to be accessed on a regular basis. Read this tutorial to learn more about Memory and Storage and how they are different from each other. What is Memory? Memory allows storing data on a short term basis. A memory normally is made up using registers. Each register has a location called memory location or storage location. Each memory location ... Read More

Difference between Basic Disk and Dynamic Disk

Mahesh Parahar
Updated on 15-Apr-2020 08:31:48

3K+ Views

Both basic disk and dynamic disk are disk configurations available in Windows Operating System. A basic disk is from initial days of DOS, Windows to till date. Dynamic Disk is available from Window 2000 onwards.Basic DiskBasic Disk Configuration works on the concept of partition, partition table, and logical drives. A disk can have up to four partitions or three partitions and one extended partition with multiple logical drives. The following operations can be performed in basic disk configuration.Create/Delete primary/extended partition.Create/Delete logical drives within an extended partition.Format a partition and mark as active.Dynamic DiskDynamic Disk Configuration works on the concept of ... Read More

Primary key Vs Unique key

sudhir sharma
Updated on 03-Feb-2020 11:11:25

10K+ Views

Primary KeyPrimary Key is a column that is used to uniquely identify each tuple of the table.It is used to add integrity constraints to the table. Only one primary key is allowed to be used in a table. Duplicate and NULL (empty) values are not valid in the case of the primary key. Primary keys can be used as foreign keys for other tables too.Let’s take an example, We have a table name employee which stores data of employees of a company. The below table shows the contents of the table.Emp_idNamePh_No.PositionSalaryEmp_id here is primary key of the table. As the ... Read More

Advertisements