Database, table and recordsDatabase tables and records are some of the simple terms we have to understand before moving towards advance topics. The main purpose of database is to store data which we can add , delete or update as and when required. We can store information or data in a simple text file or a CSV file but we will not able to handle it properly and efficiently when we will be handling large and complex interlinked data. Let us try to understand first what is a table.
Table & RecordTable is combination of a structure and some associated data or records in it. Table consist of columns which stores a particular data type and records are data we store in our table. For example we will store each employee data in an employee table. We will add one record or row when one employ joins our organization and delete the same records when he or she resign. We can update or change his department when he gets transferred to a different section of the organization.
DatabaseWhen we work in a group of related tables for a project we will group them together and store in a single database. For example in the same database server our marketing department will store all its customer data and sales related data in a marketing database ( in different tables ). Similarly we will store all employee related tables inside HR database. The tables inside a database are closely related. However we are free to store any types of table in any database.
Users of a databaseWe crate users with login id and password to assign permission to different database. Usually the permission are given to required database only. HR manager should have access to employee database and should not able to update any records of marketing database.
User previlages are decided by database administrator who is the supper user or root user of the database. Try to contact database administrator of your organization and find out how the users are created and privileges are assigned.
Why use Database or Table or Records in your script.Say you are using a student management system where you will keep all the details of students in a table. Student name, address, class of study is kept inside student table as records. Each student has one record in this table. In another table we will keep student marks. Each student will get different marks in different subjects. Similarly we will keep student fee payment details in another table.
All these three tables are kept inside one database and name of the database is student_management.
In a simple term … we keep data in records of tables and keep tables in database.