Tables Archives - {coding}Sight https://codingsight.com/category/database-development/tables/ Blog for SQL Server DBAs and Developers Thu, 14 Mar 2024 18:05:10 +0000 en-US hourly 1 https://wordpress.org/?v=6.5.2 https://codingsight.com/wp-content/uploads/2021/10/cropped-Soсial_-Fb_180х180-1-32x32.png Tables Archives - {coding}Sight https://codingsight.com/category/database-development/tables/ 32 32 MySQL Delete Column: The 2024 Ultimate Easy Guide  https://codingsight.com/drop-column-in-mysql/ Wed, 13 Mar 2024 15:44:40 +0000 https://codingsight.com/?p=26031 The MySQL delete column might sound pretty straightforward. You simply run the DROP COLUMN command, and poof! It’s gone.  However, there’s a catch. The impact of this seemingly simple action can be more far-reaching than you might have anticipated.  Deleting a column with dependencies can lead to a cascade of issues. But fear not! It’s …

The post MySQL Delete Column: The 2024 Ultimate Easy Guide  appeared first on {coding}Sight.

]]>
The MySQL ADD COLUMN Easy Guide: How to Make New Table Columns Without the Oops  https://codingsight.com/how-to-add-column-to-mysql-table/ Mon, 21 Aug 2023 09:28:21 +0000 https://codingsight.com/?p=25436 Have you made a rookie mistake when you add or insert a new column in your MySQL table?  “But what’s the big deal? Adding or inserting a new column is totally painless.”, you may say.  That’s true. Adding a column is as easy as adding a topping to a pizza or ice cream. But if …

The post The MySQL ADD COLUMN Easy Guide: How to Make New Table Columns Without the Oops  appeared first on {coding}Sight.

]]>
The SELECT INTO Temp Table Easy Guide: How to Manage Temporary Data Without Dismay        https://codingsight.com/select-into-temp-table-in-sql-server-guide/ Wed, 16 Aug 2023 16:07:54 +0000 https://codingsight.com/?p=25388 Data processing may involve several steps. And it can be fun! But the fun ends when you access some joined tables again and again. So, when you look at your SQL code, it’s yucky and ugly because of repeated lines. But what if you can store the results of those joined tables in temporary storage? …

The post The SELECT INTO Temp Table Easy Guide: How to Manage Temporary Data Without Dismay        appeared first on {coding}Sight.

]]>
Drop Temp Table in SQL Server and PostgreSQL https://codingsight.com/drop-temp-table-in-sql-server-and-postgresql/ Fri, 08 Oct 2021 09:01:28 +0000 http://codingsight.com/?p=19067 This article explains different ways to drop the temp table in SQL Server and PostgreSQL. As the name suggests, temporary tables are used to store the data temporarily. It can be used to process the data without accessing the actual table. We can create indexes, statistics, and constraints on the temp tables. Temporary Tables in …

The post Drop Temp Table in SQL Server and PostgreSQL appeared first on {coding}Sight.

]]>
Guide for CTE in SQL Server https://codingsight.com/guide-for-cte-in-sql-server/ Wed, 28 Jul 2021 09:31:59 +0000 http://codingsight.com/?p=15802 The Common Table Expression aka CTE in SQL Server provides a temporary result set in T-SQL. You can refer to it within a SQL Select, SQL Insert, SQL Delete, or SQL Update statement. The option is available from SQL Server 2005 onwards, helping the developers write complex and long queries involving many JOINs, aggregation, and …

The post Guide for CTE in SQL Server appeared first on {coding}Sight.

]]>
How to SHOW or LIST Tables in MySQL https://codingsight.com/different-ways-to-view-tables-in-mysql-server/ Mon, 26 Jul 2021 08:54:23 +0000 http://codingsight.com/?p=15772 There are two primary methods to view the tables in MySQL: In this article, we are going to explore them both. MySQL SHOW TABLES Command The show tables command displays the list of all tables created in a database. The syntax is as follows: In the syntax, Let us see the examples. Example 1: Show …

The post How to SHOW or LIST Tables in MySQL appeared first on {coding}Sight.

]]>
Stored Procedure to Delete Duplicate Records in SQL Table https://codingsight.com/how-to-delete-duplicate-records-in-a-table/ Wed, 14 Jul 2021 11:32:39 +0000 http://codingsight.com/?p=15328 Sometimes during our run as DBAs, we come up across at least one table that is loaded with duplicate records. Even if the table has a Primary Key (an auto-incremental one in most cases), the rest of the fields might have duplicate values. However, SQL Server allows for many ways to get rid of those …

The post Stored Procedure to Delete Duplicate Records in SQL Table appeared first on {coding}Sight.

]]>
How to Create a Table with Multiple Foreign Keys and Not Get Confused https://codingsight.com/how-to-create-table-with-multiple-foreign-keys-and-not-get-confused/ Fri, 28 May 2021 06:52:24 +0000 http://codingsight.com/?p=14272 Understanding Table Relations SQL server adds foreign keys to implement relations between tables in a relational database. A table can have one-to-one, one-to-many, or many-to-many relations with another table, depending upon the type of data you want to store. A one-to-one relationship is simple and rarely used. Each record in a particular table relates to …

The post How to Create a Table with Multiple Foreign Keys and Not Get Confused appeared first on {coding}Sight.

]]>
The Cartesian Product in SQL https://codingsight.com/the-cartesian-product-in-sql/ Wed, 19 May 2021 08:33:52 +0000 http://codingsight.com/?p=13760 Cartesian product in SQL is a term from the set theory of mathematics. However, we can also find this term in SQL database manuals. What does it mean, and how should we work with it? Let’s learn it. A Cartesian product of two sets X and Y, denoted X × Y, is the set of …

The post The Cartesian Product in SQL appeared first on {coding}Sight.

]]>
SQL DEFAULT Constraint to Insert Column with a Default Value to SQL Server Table https://codingsight.com/insert-column-with-default-value-to-existing-table/ Thu, 06 May 2021 11:43:09 +0000 http://codingsight.com/?p=13544 To insert data into a table having columns with default constraints, we can use the DEFAULT constraint to a default value in a table. This article will cover the following aspects: The DEFAULT constraint and required permission to create them. Adding a DEFAULT constraint while creating a new table. Adding a DEFAULT constraint into an …

The post SQL DEFAULT Constraint to Insert Column with a Default Value to SQL Server Table appeared first on {coding}Sight.

]]>