Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Databases, DBMS
course content

Course Content

Java Data Manipulation with Hibernate

Databases, DBMSDatabases, DBMS

Attention! For a better understanding of this course, it is recommended to complete the Java Essentials track as well as the SQL from Zero to Hero track. Without the courses from these tracks, it will be difficult for you to understand the material of the database course, as we will be using various data structures and SQL in this course. Therefore, it is highly recommended to complete these 2 tracks.
  1. Java Essentials
  2. SQL from Zero to Hero

Databases

Welcome to the course! This is another step towards becoming a Java Developer, keep it up!

This course will teach you how to work with databases within Java. From the course Relational Database and Normalization you should already know what a database is, the different types of databases, and how to use them correctly. However, let's quickly review the fundamental concepts once again.

Let's start from the basics, what is a database:

A database is a structured collection of data, typically stored and accessed electronically from a computer system. It allows for the efficient organization, storage, retrieval, and manipulation of data. Databases are foundational in various applications, ranging from websites, business systems to scientific research, enabling data handling in a systematic and coherent manner.

Great, you should also be aware that databases are managed through Database Management Systems (DBMS). We will also be using a DBMS called MySQL in this course. In order to complete the assignments in this course, you will need to install this DBMS on your device.

Note

It's good if you already know how to use other DBMS like Postgres, MongoDB, or SQL Server, but in this course, we will specifically use MySQL. So, it's preferable to use MySQL for the course, as if you encounter issues with other DBMS, neither I nor the community will be able to assist you :).

If you happen to encounter any issues with installing MySQL, you can refer to the step-by-step installation guide in this article. (clickable)

Types of Databases

There are two main types of databases that are in constant competition with each other: relational (SQL) and non-relational (NoSQL) databases.

  • Relational Databases (RDBMS): This is the more common type of database. Data is organized in the form of tables with columns and rows. They use the Structured Query Language (SQL) for storing, modifying, and retrieving data. Examples of RDBMS include MySQL, Microsoft SQL Server, and PostgreSQL.
  • Non-Relational Databases (NoSQL): These databases use a less structured way of storing data. They are suitable for large datasets where data access speed and scalability are of particular importance. Examples of NoSQL databases include MongoDB, Cassandra, and Redis.

SQL

Since we will be working with a relational database, it's important to understand what SQL is and what it's used for. We will use SQL frequently to create and manipulate the databases we work with. In case you've forgotten, here's a brief reminder:

SQL (Structured Query Language) is a standardized programming language used for managing and manipulating relational databases. It allows for storing, retrieving, updating, and deleting database records and is essential for tasks such as querying data, setting database schemas, and controlling access to the database's data.

With SQL, we can perform four fundamental operations for working with databases, represented by the acronym CRUD:

  • Create involves entering new data, adding new rows to a table, or creating new documents;
  • Read includes selecting and reading existing data;
  • Update involves modifying data in existing records or objects;
  • Delete includes removing existing records or objects from the database.

You can learn more about CRUD operations in this chapter. (clickable)

Basic SQL Operations

Let's go over the main SQL operations that we will use in this course. You should already know these operations from the SQL from Zero to Hero track.

  • SHOW DATABASES displays all available databases:
  • USE specifies which database to use for executing queries:
  • SHOW TABLES displays information about tables:
  • CREATE TABLE creates new tables:
  • SELECT is used to retrieve data from a table:
  • INSERT adds new records to a table:
  • UPDATE modifies existing records in a table:
  • DELETE deletes records from a table:

These are the main operations you need to be aware of.

Note

Please note that operations should be written in uppercase.

The basic material about databases has been reviewed and absorbed. Now, we can move on to more advanced usage of databases in Java-based web applications!

1. What is a database?
2. Which of the following is a feature of Relational Databases (RDBMS)?
3. What does SQL stand for?
4. Which SQL command is used to retrieve data from a table?
5. What does the acronym CRUD stand for in database operations?

question-icon

What is a database?

Select the correct answer

question-icon

Which of the following is a feature of Relational Databases (RDBMS)?

Select the correct answer

question-icon

What does SQL stand for?

Select the correct answer

question-icon

Which SQL command is used to retrieve data from a table?

Select the correct answer

question-icon

What does the acronym CRUD stand for in database operations?

Select the correct answer

Everything was clear?

Section 1. Chapter 1
some-alt