database management system vs database vs tables vs file I have been trying to understand the way a database system works. Digging through the internet, I have come to following picture.

Database system is required because we need a way to store data, mainly on large scale, so that we can update it, query it, delete it, manipulate it plus perform other operations easily. The traditional file system is not designed for this and fails to serve the purpose.
We can implement the above database system in different ways, which leads to different data models, RDBMS being the most dominant one.
There is a database management system, which is a software and is in a way like file management system, and it manages the requests of creation, deletion, insertion of data etc. Eg. SQLite.
We interact with database using an interface, which is provided by database management system, and a language which is compatible with the database management system. Eg. SQL.

I hope my understanding till now is correct.
Now, the database management system interacts with database and I am not able to understand what database is exactly. I used to think the collection of all the tables is termed a database and is just a name. But then I found out there are several databases possible and a database can be created using DBMS just like files. Further research indicated me that database is a file.
My doubts are following:

If database is a file, how does it differ from ordinary files (in terms of implementation)?
I believe that tables are also files. But tables are stored in a database. How can a file be inside a file and both can be considered separate.
The implementation of different data models, like relations to store data in rdbms, objects to store data in OOP based database systems, are they implemented in database management system or database?

And if database is not a file what is it exactly and how tables, database and database management system are related in terms of implementation?
I have tried to find answers to these but it seems like the content on these are not much and I have had no luck. Also, please explain it avoiding very involved code snippets, as I am an analys
It is probably helpful to start thinking not about the low level details, but the high-level properties/behaviours of different kinds of storage.
For example, one might consider simple files (flat, binary content), indexed files (structured access layered on top of a single simple file), with or without locking in either case supplied by OS level primitives.
In such terms, one might say that different database systems (using the term very loosely) can be characterised and contrasted with files by things like:

A query language that is used to read (and to some extent, write) data according to some complex criteria. Simple files can only be read or written by file offset. Indexed files can have some criteria, but the query language is often very simple.

A database system often has multiple types of object stored in it, with metadata structures that allow those objects to be treated in a uniform manner by the query language. With simple files, and indexed files, you have to build all those aspects yourself.

A database system is often network-accessible, including with locking semantics. Simple files can be exposed by a network filesystem layer, but the locking semantics are often lost or changed when you do so. I'm not aware of any system (other than possibly some obsolete systems from the 1980s) that even attempt this for indexed files.


One might continue such an analysis for many other behaviours and properties. As you do that, the details of your questions and assumptions can be answered with regard to those behaviours and properties.
Of course, it is also true that many database systems are built on top of simple files provided by the operating system. But that is not a given - it is in fact common for high performance database systems to access the disks using some kind of &quot;raw&quot; I/O too. Files just happen to be a convenient abstraction to avoid the database system having to replicate a lot of things that the operating system's file access layers already do.