Database is a collection of related information that is organized in such a way that supports for easy access, modify and maintain data.
The database is managed by some special software packages known as Database Management Systems (DBMSs). The purpose of DBMS software is to allow the user to create, modify and administration of database. Examples of database management systems are: Ms-Access, MySQL, SQLite, Microsoft SQL Server, Oracle, SAP, dBASE, FoxPro, etc.
Relational data model
The relational data model is a database model. In the relational data model, database is
represented as collection of related tables. Each table is termed as relation. Tables are formed by using rows and columns.
A row (horizontal subset) of a table represents a tuple or record.
A column (vertical subset) of a table represents an attribute or field.
Relation/Table
In database, a relation means a ‘table’, in which data are organized in the form of rows and columns.
Domain:- a domain refers to all the possible unique values of a particular column.
Keys
Keys are an important part of a relational database . They help identify the relationship between tables. There are three main types of keys – candidate keys, primary keys, foreign keys and alternate keys.
Primary Key: A column that uniquely identifies a row within a table is called primary key. It should be unique and not null. For example rollno
Candidate Key: Candidate keys are set of fields in the relation that are eligible to act as a primary key. For example rollno,admno,stuid
Alternate Key: Out of the candidate keys, after selecting a key as primary key, the remaining keys are called alternate key.
Foreign Key: A foreign key is a field in one table as a primary key and in another table as non primary key field for that table known as a foreign key and it is used to establish a link between two tables.
Degree:- The degree is total number of attributes (columns) in a table.
Cardinality:-Cardinality is total number of rows (tuples) in a table.
Candidate Key:- In the above table, Ad No and Name has unique values. Therefore, Ad No and Name are candidate keys.
Primary Key: Out of the Ad No and Name, Ad No is the primary key.
Alternate Key: In the candidate key, Ad No is the primary key and the Name is the Alternate key.
Team NB Learner