0% found this document useful (0 votes)
51 views18 pages

Relational Database Management Systems (Basic)

The document provides definitions and explanations of key concepts in relational database management systems including: data, database, DBMS, flat file vs relational databases, database server, advantages of databases, key features of databases, RDBMS, how data is organized in RDBMS, relationships between primary and foreign keys, candidate key, primary key, composite primary key, and foreign key.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
51 views18 pages

Relational Database Management Systems (Basic)

The document provides definitions and explanations of key concepts in relational database management systems including: data, database, DBMS, flat file vs relational databases, database server, advantages of databases, key features of databases, RDBMS, how data is organized in RDBMS, relationships between primary and foreign keys, candidate key, primary key, composite primary key, and foreign key.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 18

Information Technology (402)

Important Questions with Solutions

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) What do you mean by database?


A database is an organized collection of data. You can visualize it as a container of information.
A database is an organized collection of data, generally stored and accessed electronically from a
computer system. Where databases are more complex, they are often developed using formal
design and modelling techniques.

3) Explain DBMS with example?


A database management system is a software package with computer programs that controls the
creation, maintenance, and use of a database. It allows organizations to conveniently develop
databases for various applications. A database is an integrated collection of data records, files, and
other objects. A DBMS allows different user application programs to concurrently access the same
database.
Well known DBMSs include Oracle, IBM DB2, Microsoft SQL Server, Microsoft Access, PostgreSQL,
MySQL, FoxPro, and SQLite.
or
The database management system (DBMS) is the software that interacts with end users,
applications, and the database itself to capture and analyze the data. The DBMS software
additionally encompasses the core facilities provided to administer the database. The sum total of
the database, the DBMS and the associated applications can be referred to as a "database system".
Often the term "database" is also used to loosely refer to any of the DBMS, the database system
or an application associated with the database.

4) Differentiate flat file and relational?


Data can be organized into two types:
• Flat File: Data is stored in a single table. Usually suitable for less amount of data.
• Relational: Data is stored in multiple tables and the tables are linked using a common field.
Relational is suitable for medium to large amount of data.

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).

✓ Composite primary key


When multiple fields are used as a primary key, they are called a composite key.
A primary key having two or more attributes is called composite key. It is a combination of two or
more columns.
An example can be –

Here our composite key


is OrderID and ProductID.

Full Explanation: https://youtu.be/VGNgV_roUnI


6|Page
✓ Foreign key

S.no. Primary key Foreign key


The primary key of a particular table is
The foreign key of a particular table is simply the
the attribute which uniquely identifies
1 primary key of some other table which is used as a
every record and does not contain any
reference key in the second table.
null value.
A primary key attribute in a table can
2 A foreign key attribute may have null values as well.
never contain a null value.
Not more than one primary key is A table can have one or more than one foreign key for
3
permitted in a table. referential purposes.
Duplicity is strictly prohibited in the
Duplicity is permitted in the foreign key attribute;
4 primary key; there cannot be any
hence duplicate values are permitted.
duplicate values.
Now, let us consider the table teacher, which records
the teachers in the school:
Example:
Here Tid or teacher id is the unique primary key, for
Consider the table student, which keeps each record in the table. This table uses the “ID”
record of students in a class: attribute which is the primary key of the “student”
table as its reference key or foreign key to refer to the
Here, Id is the primary key which student the particular teacher teaches, :
uniquely identifies each record in the
5 table “student” TID NAME TAddress ID
1 Priya P 101
ID NAME Address 2 Riya R 102
101 ABC x 3 Sam S 102
102 DEF y 4 Tom T 103
103 GHI z
104 JKL w Since one student is taught by more than one teacher,
the ID attribute (which is the foreign key in this
table), contains duplicate values

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.

3) How many ways can we create a table?


• Use Wizard to Create Table
• Create table in Design View
4) How can you create a table using design view?
1. Click on Create Table in Design View… option available under Tasks and a Table Design window.
2. Specify the field name and data type of the field to be created by selecting the appropriate
type available under Field type dropdown list.
3.

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?

7) List datatypes available in alphanumeric?

8) Differentiate between Tuples and Attributes of a table.


TUPLE: Is the "ROW" in a table and ATTRIBUTE: Is the "COLUMN" and it can also be called as
"ATTRIBUTE". Annapurna table is collection of attributes .... attribute is nothing but property tuple
is the collection of information about the attributes of table for single instance
Or
A relation is a two-dimensional table. It contains number of rows (tuples) and columns
(attributes). This is the horizontal part of the relation. One row represents one record of the
relation. The rows of a relation are also called tuples.
Or
An attribute is a name paired with a domain (nowadays more commonly referred to as a type or
data type). An attribute value is an attribute name paired with an element of that attribute's
domain, and a tuple is a set of attribute values in which no two distinct elements have the same
name.

11 | P a g e
9) Name different Binary data types.

12 | P a g e
SESSION 3: PERFORM OPERATIONS ON TABLE

1) How can you insert data in a table?


To insert the data in the table, follow the steps:
• Select the table > Double click on it.
• The table will open in Datasheet View in which data new data can be inserted and existing
data can be updated or removed.

2) How can you edit record in a table?


To edit the data either click on edit icon or double on the data in the cell of a table and
modifications can be done.
3) Explain any 4 field properties.
In design view there are different properties of fields according to the data type set for each field.
The properties of numeric type data is shown below in the figure.
Like
Auto Value – if set to yes then field will get the auto numeric values.
Length – By default length of the field is 10 but the size of the field can be set to maximum length.
Default Value – A default value can be set for a field if user don’t provide any value while entering
the values in the table.
Format example – This property helps to set the format of the data entered in the field such as
91-222-333.
4) How can you sort data in a table?
Sorting means to arrange the data in either ascending order of descending order. Select the
column(s) then click on sort buttons. The data will be displayed accordingly.

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

1) What do you mean by filtering?


Having created the tables and entering data into them, now you want to extract some information.
That’s when you query the database. As the name suggests, query is to collect specific information
from the pool of data. A query helps us join information from different tables and filter that
information. Filtering means that the query uses criteria you provide to hide some data and
present only what you want to see.
2) Explain query?
A query is a question, often expressed in a formal way. A database query can be either a select
query or an action query. A select query is a data retrieval query, while an action query asks for
additional operations on the data, such as insertion, updating or deletion.
or
A database query is a request for data from a database. Usually, the request is to retrieve data;
however, data can also be manipulated using queries. The data can come from one or more tables,
or even other queries.
3) What are the steps to create query using design view?
Data Manipulation Language (DML) statements or commands are used for managing data within
tables. Some commands of DML are:
Some commands of DML are:
SELECT – retrieve data from a database
INSERT – insert data into a table
UPDATE – updates existing data within a table
DELETE – deletes all records from a table, the space for the records remain
4) Which clause of Select statement helps to display specific data?
To display the records containing the same type of values “WHERE” clause can be used with the
Select SQL Command.
To get details about the list of students whose favourite colour is blue, you can use:
select * from Details where Colour=’Blue’;
5) Differentiate between Where and Order by clause of SQL statements.
The SQL ORDER BY clause is used to sort the data in ascending or descending order, based on one
or more columns. Some databases sort the query results in an ascending order by default.
You can use more than one column in the ORDER BY clause. Make sure whatever column you are
using to sort that column should be in the column-list.

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.

6) State the purpose of Update Command with the help of an example.


The SQL UPDATE Query is used to modify the existing records in a table. You can use the WHERE
clause with the UPDATE query to update the selected rows, otherwise all the rows would be
affected.

16 | P a g e
SESSION 5: CREATE FORMS AND REPORTS USING WIZARD

1) What do you mean by form?


A form provides the user a systematic way of storing information into the database. It is an
interface in a user specified layout that lets users to view, enter, and change data directly in
database objects such as tables.
2) What are the steps to create forms using wizard?
a) Click Use Wizard to Create Form… option under Tasks group. The Form Wizard dialog box
appears.
b) You can select selective fields to be sent onto the form by selecting the field name and
clicking >button. You can select individual fields in a database or all fields in a database.
c) To use all the fields in the table in a form, click the >> button.
d) Notice the fields displayed under Fields in the forms section
e) Click Next >. You see the Set up a sub form step dialog box of the wizard
f) You can select the option Add Sub form if you need to insert the contents in the table in a
separate form. Click Next.
g) Now you need to arrange selected fields in a form. You can use different styles from the
list displayed.
h) Once you have selected a style, click Next >A dialog box appears wherein you can select
the data entry model.
i) Click Next >. You should see a dialog box wherein you can specify the styles to be used in
the form.
j) Click Next >. You see a dialog box where you can specify the name of the form. Click Finish.
k) A form window appears. Notice that the records in the table are displayed automatically
within the form that you just created.
3) What is the purpose of creating Reports?
A report helps to display the data in a summarized manner. It is used to generate the overall work
outcome in a clear format. You can create reports in the database.
4) Can a form display data from queries?
Yes
5) In how many ways Forms and Reports can be created in a database?
Form:
Design View – Create a form specifying the record source, controls and controls properties.
Wizard: The wizard will guide you through the steps necessary to create a form.
Report:
Wizard: The wizard will guide you through the steps necessary to create a report.
6) What are the prerequisites to create a form and reports?
Forms allow you to both add data to tables and view data that already exists. Reports present data
from tables and also from queries, which then search for and analyze data within these same
tables.

17 | P a g e
18 | P a g e

You might also like