Introduction In this article, we will see the development of a form for feedback, surveys, and user data. The survey form should have an appealing outlook, as well as guarantee that the data collected is reliable and systematized. In this, we will see how to create a survey form in HTML and CSS that is fully functional as well as visually appealing. Overview Here, the goal of this article is to help you understand the process of making a survey form responsive and beautiful with the common data about the user that are name or nickname, e-mail, age, and position, ... Read More
To improve query efficiency, MySQL has a specific data type called ENUM that stores string values as numeric indexes. By limiting values to particular possibilities, ENUM, in contrast to standard string types, ensures data consistency and streamlines comparisons. The SHOW COLUMNS statement is used to fetch all the possible values of ENUM, under the type column this is a straightforward way to understand, and validate data and also to check the constraints in the database schema. Retrieving the possible values of ENUM In the below example let us see how to create an ENUM column, fetch the data, and ... Read More
Filtering data by date or datetime is a common requirement when working with SQL queries. Whether you're retrieving records for a specific date, a range of dates or precise timestamps SQL provides robust tools to handle such scenarios. Understanding Date and DateTime Data Types The SQL databases support various data types for storing the date and time information: DATE: Stores only the date (e.g. 2025-01-07). DATETIME: The Stores both date and time (e.g. 2025-01-07 14:30:00). TIMESTAMP: The Stores date and time with time zone information in some ... Read More
Converting rows into columns also known as pivoting is a common requirement in SQL. Pivoting transforms data to present it in a more organized, user-friendly format, especially for reporting or analytics purposes. In this article, we’ll explore the different methods available in MySQL to achieve this transformation. Let’s consider a sample table named sales: Year Region ... Read More
In MySQL, the ENUM data type allows you to create a column with specified values like 'A', 'B', 'C', and 'D'. This feature is useful for maintaining data consistency, as it restricts entry to a specific set of values. However, the behavior of ENUM columns can vary depending on whether the NOT NULL constraints are applied and also depends on SQL modes. How to handle ENUM values with SQL modes MySQL accepts empty values for enumeration only if SQL mode is not set as TRADITIONAL, STRICT_TRANS_TABLES, or, STRICT_ALL_TABLES. Otherwise, MySQL would not accept empty values and throw an error. ... Read More
In SQL, joining tables is an essential operation that combines data from multiple sources. While joining two tables is straightforward many real-world scenarios require joining three or more tables to retrieve comprehensive information. This article explains how to join three or more tables, complete with examples. Understanding Joins SQL joins are used to combine rows from two or more tables based on a related column. The Common types of joins include: INNER JOIN: Returns records that have matching values in both tables. ... Read More
Namespaces help in organizing code, managing the scope of variables and preventing naming conflicts. Python and C++ use namespaces, but they do so in different ways. Below is an overview of namespaces in both. Namespaces in C++ In C++, namespaces are created using the keyword 'namespace'. They are mainly intended to organize code into logical groups and avoid name conflicts, particularly when working with multiple libraries. Example In the following example we are going to how to use a namespace by utilizing '::' to access functions within that namespace. #include using namespace std; // first namespace namespace first_space ... Read More
In MySQL, triggers are a mechanism that allow for specific actions to be executed automatically when specific events like Insert, Update, or Delete occur in a table. They are useful as they automate processes and maintain data integrity. Using BEGIN...END in trigger In a trigger, if we want to perform more than one action we write it within the BEGIN…END block. This block simplifies the way we can manage a larger number of actions for a more complicated task. Let us see how the BEGIN...END construct allows multiple statements to be executed within a trigger. We can group ... Read More
Triggers are automatic operations that MySQL performs when something happens in a table, like adding a new record (INSERT), changing a record (UPDATE), or getting rid of a record (DELETE). They come in handy because they can handle repetitive tasks and make sure the info in your database is consistent and accurate without any manual interference. Listing All Triggers in MySQL To list all the triggers in MYSQL we use information_schema.triggers table. This table stores the metadata, which means the details like the trigger name, the action it responds to (INSERT, UPDATE, DELETE), and the table it is associated with. ... Read More
Triggers are a great feature in MySQL that allows the automation of processes either before or after data has changed in a table. An important application of the usage of triggers is for automatic date addition to the database. This article guides you on how to add the current date in MySQL using triggers every time a new record is being inserted. The following examples uses a BEFORE INSERT trigger in setting a date within a column of a table automatically. BEFORE INSERT trigger This trigger is executed right before a value is inserted into a database table. Whenever ... Read More
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP