Found 4401 Articles for MySQL

Basic SQL Commands

Raunak Jain
Updated on 10-Jan-2023 17:33:24

1K+ Views

SQL (Structured Query Language) is a programming language used to communicate with databases. It is a standard language for interacting with relational databases and is essential for anyone working with databases. In this article, we will cover some basic SQL commands that you can use to interact with your database. Introduction to SQL SQL is a programming language designed specifically for interacting with databases. It allows you to create, modify, and query databases. SQL is used by a wide range of applications, including web applications, data analysis, and data management systems. It is a declarative language, which means that you ... Read More

Basic operations and Working of LOB

Raunak Jain
Updated on 10-Jan-2023 17:30:22

273 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
Updated on 10-Jan-2023 16:00:43

3K+ 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

What are various Inheritance mapping strategies available in Hibernate?

Manu
Updated on 26-Aug-2022 11:47:53

709 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
Updated on 26-Aug-2022 11:40:06

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
Updated on 26-Aug-2022 11:28:09

7K+ 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

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

Bhanu Priya
Updated on 03-Jul-2021 08:45:34

3K+ 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

What is the use of update command in SQL?

Bhanu Priya
Updated on 03-Jul-2021 08:42:19

4K+ Views

Update command is a data manipulation command which is used to edit the records of a table. It may be used to update a single row based on a condition, all rows or set of rows based on the condition given by the user.It is used along with the SET clause, operationally, a WHERE clause may be used to match conditions −Example 1An example is given below for the use of update command −update table student set name=’sneha’ where branch=’CSE’;Example 2Given below is another example of the usage of update command −create table employee(ename varchar(30), department varchar(20)); insert into employee ... Read More

How can you order the result obtained by select query in MySQL?

Pawandeep Kaur
Updated on 10-Jun-2021 12:26:46

576 Views

It is common to select certain data or rows from a table. The rows are returned in the order in which they appear in the table. We may sometimes require that the rows we select from the table must be returned to us in ascending or descending order with respect to some column.The “ORDER BY” statement is used to order the results with respect to some column. The following example will provide more clarity.Suppose, we have a table which consists of various fields including the “name” field. We want to select all the rows from the table but we want ... Read More

Updating a record in MySQL using NodeJS

Mayank Agarwal
Updated on 28-Apr-2021 07:03:17

1K+ Views

In this article, we will see how we can update a record in MySQL using NodeJS. We will dynamically update MySQL table values from Node.js server. You can use the select statement after updating to check if the MySql record is updated.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 in the project folder.Upadting a Record into the Students Table −For updating an existing record into the MySQL table, firstly create an app.js fileNow copy-paste the below snippet in the fileRun the ... Read More

Previous 1 ... 6 7 8 9 10 ... 441 Next
Advertisements