Relational Database Management Systems (Basic)
Relational Database Management Systems (Basic)
Unit
RELATIONAL DATABASE MANAGEMENT SYSTEMS (BASIC)
1|Page
SESSION 1: APPRECIATE CONCEPT OF DATABASE MANAGEMENT
SESSION 1: CREATE AND APPLY STYLES IN THE DOCUMENT
SYSTEM
1) What do you mean by data?
Data, in the context of databases, refers to all the single items that are stored in a database, either
individually or as a set. Data in a database is primarily stored in database tables, which are
organized into columns that dictate the data types stored therein. So, if the “Customers” table has
a column titled “Telephone Number,” whose data type is defined as “Number,” then only numerals
can be stored in that column.
Data, even in a database, is rarely useful in its raw form. For example, in a banking application,
data is the whole collection of bank account numbers; bank customers’ names, addresses, and
ages; bank transactions and so on.
2|Page
5) What do you mean by database server?
Database servers are dedicated computers that hold the actual databases and run only the DBMS
and related software. Typically, databases available on the database servers are accessed through
command line or graphic user interface tools referred to as Frontends; database servers are
referred to as Back-ends. Such type of data access is referred to as a client-server model.
6) What are advantages of database?
• Reduces Data Redundancy
• Sharing of Data
• Data Integrity
• Data Security
• Privacy
• Backup and Recovery
• Data Consistency
For more deep information page number: 110 (CBSE Draft Study Material)
7) What are key features of database?
1. A database can have one or many tables. An address book example is a very simple one, in real
world there are many more details involved. A big company would have in its database, one table
for its products, one table for its suppliers, one table for its customer details, one for orders
received and maybe many others.
2. Each table in a database contains information about one type of item. So, a database is a
container that holds tables and other objects and manages how they can be used.
3. Another very important thing to remember is that when we put in information, we may have
people with the same name (there can be more than one Charu Arora) or the same address
(members of a family). But when creating a database an important feature is record uniqueness in
every table. it is important to be able to distinguish between different items having duplicate
values.
Uniqueness helps to avoid accidental duplication of records caused by user or computer error. This
can be achieved by using some number or value that uniquely identifies a record. If such a unique
value does not exist in your fields, as the database designer, you can create a special additional
field in a table where unique numbers or values can be assigned for each new entry. Therefore,
every table has a key field which ensures that there are 100% unique values throughout the
database.
4. Every database table should have one or more fields designated as key. You can assign a unique
value to this key for differentiating records that may have similar names or addresses.
8) Explain RDBMS with example?
A relational database is a type of database. It uses a structure that allows us to identify and access
data in relation to another piece of data in the database. Often, data in a relational database is
organized into tables.
3|Page
or
A relational database is a digital database based on the relational model of data, as proposed by
E. F. Codd in 1970. A software system used to maintain relational databases is a relational database
management system (RDBMS). Many relational database systems have an option of using the SQL
(Structured Query Language) for querying and maintaining the database.
Relationships are a logical connection between different tables, established on the basis of
interaction among these tables.
9) How a data is organised in RDBMS?
MySQL is a Relational Database Management System (RDBMS), which means the data is organized
into tables. RDBMS tables are organized like other tables that you're used to — in rows and
columns. The individual cell in which a particular row and column intersect is called a field.
10) State relation between primary and foreign key?
A primary key-foreign key relationship defines a one-to-many relationship between two tables in
a relational database. A foreign key is a column or a set of columns in one table that references
the primary key columns in another table. The primary key is defined as a column (or set of
columns) where each value is unique and identifies a single row of the table.
Consider Figure 5.1, where the upper table is a fact table named Sales and the lower table is a
dimension table named Date. The Sales fact table contains one row for every sales transaction,
and the Date dimension table contains one row for every date the database will potentially cover.
Figure 5: 1
or
A primary key-foreign key relationship defines a one-to-many relationship between two tables in a relational
database. A foreign key is a column or a set of columns in one table that references the primary key columns in
another table.
4|Page
11) Define the following
✓ Candidate Key
Each table has only a single primary key. Each relation may have one or more candidate key. One
of these candidate keys is called Primary Key. Each candidate key qualifies for Primary Key.
Therefore, candidates for Primary Key is called Candidate Key.
Candidate key can be a single column or combination of more than one column. A minimal super
key is called a candidate key.
5|Page
✓ Primary key
A primary key is a field in a table which uniquely identifies each row/record in a database table.
Primary keys must contain unique values. A primary key column cannot have NULL values.
A table can have only one primary key, which may consist of single or multiple fields. When
multiple fields are used as a primary key, they are called a composite key.
If a table has a primary key defined on any field(s), then you cannot have two records having the
same value of that field(s).
7|Page
SESSION 2: CREATE AND EDIT TABLES USING WIZARD & SQL
2COMMANDS
1) Define
RDBMS:
A relational database is a collective set of multiple data sets organized by tables, records and
columns. Relational database establish a well-defined relationship between database tables.
Tables communicate and share information, which facilitates data searchability, organization and
reporting. A Relational database use Structured Query Language (SQL), which is a standard user
application that provides an easy programming interface for database interaction
Tables:
A table is a set of data elements (values) that is organized using a model of vertical columns (which
are identified by their name) and horizontal rows. A table has a defined number of columns, but
can have any number of rows. Each row is identified by the values appearing in a particular column
identified as a unique key index or the key field.
Columns or Fields or Attributes:
A column is a set of data values of a particular simple type, one for each row of the table.
The columns provide the structure according to which the rows are composed. For example,
cFirstName, or cLastName are fields in a row.
Rows or Records or Tuples:
A row also called a Record or Tuple represents a single, data item in a table. In simple terms, a
database table can be visualized as consisting of rows and columns or fields. Each row in a table
represents a set of related data, and every row in the table has the same structure.
8|Page
2) How can you create a database using open office?
Click Start>Programs>OpenOffice.org 4>OpenOffice.org Base.
You should be guided through the Database Wizard for creating a database.
You will see a dialog box similar to the one displayed below.
You can create a new database by selecting the option Create a new database. You can also open
an existing database file that you have already created by selecting the option Open an existing
database file. Click Next. A dialog box similar to the one displayed below appears.
Click Finish. The Save As dialog box appears as shown below. Specify a name for the database in
the File name: field and click Save. A window similar to the one displayed below. Click Finish. The
Save As dialog box appears as shown below.
9|Page
Specify a name for the database in the File name: field and click Save.
Now that you have created a database, you can work with the database as outlined in the next
few sessions.
4. Specify the table name. The default name is Table1. Click OK.
5. You are asked to set a primary key for the table you just created. You can select the appropriate
option to set the primary key or leave the table without a primary key. If you click Yes, the
application will set the primary key for the first field created automatically.
5) Explain data types? Or Why are data types used in DBMS , RDBMS ?
Datatypes are used to identify which type of data (value) we are going to store in the database.
Fields themselves can be of different types depending on the data they contain. Data types in
OpenOffice base are broadly classified into five categories listed below.
• Numeric Types
• Alphanumeric Types
• Binary Types
• Date time
• Other Variable types
10 | P a g e
6) List datatypes available in numeric datatype?
11 | P a g e
9) Name different Binary data types.
12 | P a g e
SESSION 3: PERFORM OPERATIONS ON TABLE
13 | P a g e
5) Explain referential integrity?
Referential integrity is used to maintain accuracy and consistency of data in a relationship. In Base,
data can be linked between two or more tables with the help of primary key and foreign key
constraints.
Referential integrity helps to avoid:
• Adding records to a related table if there is no associated record available in the primary
key table.
• Changing values in a primary if any dependent records are present in associated table(s).
• Deleting records from a primary key table if there are any matching related records
available in associated table(s).
6) How many types of relationship can we create in a table?
There are three types of relationships which can be created in tables:
1. ONE to ONE: In this relationship, both the tables must have primary key columns.
2. ONE to MANY OR MANY to ONE: In this relationship, one of the table must have primary key
column. It signifies that one column of primary key table is associated with all the columns of
associated table.
3. MANY to MANY: In this relationship, no table has the primary key column.
It signifies that all the columns of primary key table are associated with all the columns of
associated table.
7) How can we remove relationship?
The relationships applied on the tables can be removed also with the help of Delete option. Right
Click on the relationship thread and select Delete option.
8) What is the file extension for databases created using OpenOffice.Org Base?
.odb
14 | P a g e
SESSION 4: RETRIEVE DATA USING QUERY
The SQL WHERE clause is used to specify a condition while fetching the data from a single table or
by joining with multiple tables. If the given condition is satisfied, then only it returns a specific
value from the table. You should use the WHERE clause to filter the records and fetching only the
necessary records.
15 | P a g e
The WHERE clause is not only used in the SELECT statement, but it is also used in the UPDATE,
DELETE statement, etc., which we would examine in the subsequent chapters.
16 | P a g e
SESSION 5: CREATE FORMS AND REPORTS USING WIZARD
17 | P a g e
18 | P a g e