MySQL Articles

Page 13 of 355

Basic operations and Working of LOB

Raunak Jain
Raunak Jain
Updated on 10-Jan-2023 549 Views

LOB, or Large OBject, is a data type in database management systems (DBMS) used to store large amounts of unstructured data, such as text, images, and videos. LOB data types are useful for storing and manipulating data that does not fit neatly into a traditional row-and-column structure, such as documents, graphics, or audio files. In this article, we will explore the basic operations and working of LOB data types in DBMS and SQL. We will also provide examples of how to use LOB data types in SQL for storing and manipulating large amounts of unstructured data. Types of LOB Data ...

Read More

Audit Trail in DBMS

Raunak Jain
Raunak Jain
Updated on 10-Jan-2023 5K+ Views

Introduction An audit trail, also known as a transaction log, is a record of all changes made to a database in a DBMS (database management system). It is used to track and monitor database activity, identify and troubleshoot issues, and ensure data integrity and security. In this article, we will explore the purpose and benefits of audit trails in DBMS, how they work, and provide real-life and SQL code examples of their implementation and use. What is an audit trail in DBMS? An audit trail is a chronological record of all database transactions, including insertions, updates, and deletions. It captures ...

Read More

Difference between localhost and 127.0.0.1?

Kiran Kumar Panigrahi
Kiran Kumar Panigrahi
Updated on 01-Dec-2022 7K+ Views

On almost every machine, the localhost and 127.0.0.1 are functionally the same. But, they are not exactly the same. This article is meant for explain the important differences between localhost and 127.0.01. What is Localhost? "localhost" is the machine name or IP address of the host server. You can think of it as the domain name for "127.0.0.1". The localhost allows a network connection to loop back on itself. It is a communication port that is connected to the local server. It helps us in spoofing the network connections when such a network does not exist. We tend to use ...

Read More

What are various Inheritance mapping strategies available in Hibernate?

Manu
Manu
Updated on 26-Aug-2022 1K+ Views

There are three types of inheritance mapping strategies − Table per class hierarchy Table per concrete class Table per subclassIn this article, we will discuss table per class hierarchy. Table per class hierarchy In this, only a single table is created for inheritance mapping. Disadvantages of this approach is that a lot of null values gets stored in the table. @Inheritance(strategy=InheritanceType.SINGLE_TABLE), @DiscriminatorColumn and @DiscriminatorValue are the annotations used in this strategy. @DiscriminatorColumn is used to create an additional column which is used to identify the hierarchy classes. Consider the following example to understand this − Steps ...

Read More

How to Execute Batch Insert Update in Hibernate?

Manu
Manu
Updated on 26-Aug-2022 3K+ Views

In this article, we will see how we can execute batch insert/update in hibernate. Whenever we execute a sql statement, we do it by making a network call to the database. Now, if we have to insert 10 entries to our database table, then we have to make 10 network calls. Instead we can optimize our network calls by using batching. Batching allows us to execute a group of SQL statements in a single network call. To understand and implement this, let us define our entities − @Entity public class Parent { @Id @GeneratedValue(strategy ...

Read More

How to connect hibernate with MySQL Database?

Manu
Manu
Updated on 26-Aug-2022 10K+ Views

In this article, we will see how we can connect to MySQL database using an ORM (object relational mapping) framework like hibernate. First of all, we need to add maven dependency for hibernate in our pom.xml file − org.hibernate hibernate-core 5.6.2.Final Now, let us define an entity class that will be mapped to a database table using hibernate. @Entity @Table( name = " Employee") public class Employee { @Id @GeneratedValue(strategy = GenerationType.AUTO) Long id; @Column(name = ...

Read More

Priority of AND and OR operator in MySQL select query?

Chandu yadav
Chandu yadav
Updated on 06-Aug-2021 1K+ Views

The AND has the highest priority than the OR operator in MySQL select query.Let us check how MySQL gives the highest priority to AND operator.The query is as followsmysql> select 0 AND 0 OR 1 as Result;The following is the output+--------+ | Result | +--------+ | 1     | +--------+ 1 row in set (0.00 sec)If you are considering the OR operator has the highest priority then MySQL will wrap up the above query like this.The query is as followsselect 0 AND (0 OR 1) as ResultFirst, solve the 0 OR 1, this will give result 1. After that ...

Read More

Explain the difference between a table, view and synonym in SQL

Bhanu Priya
Bhanu Priya
Updated on 03-Jul-2021 4K+ Views

Let us understand what table, view and synonym in the structured query language (SQL) are.Table, view and synonymA table is a repository of data, where in the table it is a physical entity. A table resides physically in the database.A view is not a part of the database’s physical representation. It is precompiled, so that data retrieval behaves faster and also provides a secure accessibility mechanism.A synonym is an alternate name assigned to a table, view, sequence or program unit.ExampleCreate table employee (empID integer primary key, name varchar2(30), skill varchar2(30), salary number(20), DOB datetime).Let’s say there is a scenario where ...

Read More

Dropping a MySQL Table using NodeJS

Mayank Agarwal
Mayank Agarwal
Updated on 27-Apr-2021 707 Views

You can delete an existing table from MySql Database using the "DROP TABLE" statement in Node. Sometimes, we need to delete the whole table, though in corporates it is always advised to archive the tables which are not in used instead of deleting them.While deleting a table, we have two scenarios −Deleting a table if it exists, else throw an errorDeleting the table whether it exists or not.We will discuss both the scenarios here.Before proceeding, please check the following steps are already executed −mkdir mysql-testcd mysql-testnpm init -ynpm install mysqlThe above steps are for installing the Node - mysql dependecy ...

Read More

Creating a MySQL Table in NodeJS using Sequelize

Mayank Agarwal
Mayank Agarwal
Updated on 27-Apr-2021 2K+ Views

Introduction to SequelizeSequealize follows the promise-based Node.js ORM for different servers like – Postgres, MySQL, MariaDB, SQLite, and Microsoft SQL Server.Following are some of the main features of NodeJS sequelize −Transaction SupportRelationsEager and Lazy LoadingRead Replication and more...Connecting to MySQL using SequelizeWe need to establish a connection between MySQL and Node.js using Sequelize.After creating a successful connection with sequelize, we would require the following three files for configuration. Please carefully create the following files in their respective folders only.SequelizeDemo > application.jsThis will be our root file which will hold the actual logic.SequelizeDemo>utils>database.jsThis will hold all the connection details to MySQL.SequelizeDemo>models>user.jsThis ...

Read More
Showing 121–130 of 3,543 articles
« Prev 1 11 12 13 14 15 355 Next »
Advertisements