All articles: Data Definition Language (DDL)

Checkout our self-help content, created by our top Experts!
Returning Random Rows using TABLESAMPLE – Querychat
When doing data analysis, we might need to select a random sample of data from a table to get an idea about the data distribution. SQL Server has the TABLESAMPLE clause that we can use to return a random set of rows. In this article, we will learn how TABLESAMPLE...
Nonclustered Indexes in SQL Server – Querychat
In SQL Server, we can only have one clustered index that physically sorts the table based on the clustering key. However, we can add secondary sorting based on other columns by adding nonclustered indexes. In this article, we will learn the basics of nonclustered indexes and several examples of how...
Clustered Indexes in SQL Server – Querychat
In this article, we will learn the basics of clustered indexes in SQL Server. We will also take a look at several examples of how to create a clustered index using T-SQL. Clustered Indexes A clustered index is also called the primary index of a table. It sorts and defines...
How to Disable Foreign Key Constraints in SQL Server – Querychat
SQL Server allows us to disable a foreign key constraint on a table using Management Studio and T-SQL. After we disable the constraint, future inserts and updates to the foreign key column will not be validated against the values from the referenced table.  There are cases when we would want...
How to modify a stored procedure in MS SQL Server – Querychat
Stored procedures are essential objects when it comes to performing DML operations on an application level. We often need to modify previously created procedures, either due to database or business rules modifications. This article elaborates two ways of modifying a stored procedure in SQL Server: via UI and SQL code...
SQL Database Design Best Practices – Querychat
When designing databases, some guidelines need to be followed in case we want to build an effective and useful database system. This article elaborates on best practices when it comes to SQL Server database design. Database Design Basics Implementation of SQL database structure is a complex process. The process requires...
The Difference Between CHAR, VARCHAR, and TEXT in MySQL – Querychat
In this article, we will discover the difference between character types of MySQL, namely the CHAR, VARCHAR, and TEXT.  Differences in speed between these three MySQL data types will be very difficult to detect until our database grows to quite large volumes. So which one is the easiest to work...
Understanding Pages in SQL Server – Querychat
Pages are essential building units of every SQL database we deal with. In order to design an efficient database, understanding how data will be stored in a database is a must. This article elaborates on the definition of the SQL Server page and introduces us to different page types within...
An Intro to Columnstore Indexes – Querychat
Columnstore indexes are designed for storing and querying wide tables such as fact tables in a data warehouse. They were introduced in SQL Server 2012 version, and Microsoft has kept increasing the benefits of this feature in the newer versions. In this article, we will learn what the columnstore index...
What is Primary and Foreign Key in SQLite – Querychat
In this article, we will find out what are the primary and foreign keys and what is their purpose in SQLite. SQLite primary key The primary key is what makes each row of our records in the database unique. Thanks to the primary key, each record has its own unique...
1 2 13 14