0% found this document useful (1 vote)
1K views

DBMS Questions-Answers

This document provides answers to questions about database management systems and relational database management systems. It defines key terms like DBMS, RDBMS, tuples, attributes, primary keys, foreign keys, and data types. It also describes how data is organized in tables in an RDBMS and the relationships between tables using primary and foreign keys.

Uploaded by

Suyash Mishra
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (1 vote)
1K views

DBMS Questions-Answers

This document provides answers to questions about database management systems and relational database management systems. It defines key terms like DBMS, RDBMS, tuples, attributes, primary keys, foreign keys, and data types. It also describes how data is organized in tables in an RDBMS and the relationships between tables using primary and foreign keys.

Uploaded by

Suyash Mishra
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 13

DATABASE MANAGEMENT SYSTEM

Q1. What does DBMS Stands for?


Ans. DBMS stands for Database Management System.
Q2. What does RDBMS Stands for?
Ans. RDBMS stands for Relational Database Management System.
Q3. How is data organized in a RDBMS?
Ans. The Relational Database Management System (RDBMS)
organizes the data into tables. In tables vertical lines are called fields
and horizontal lines are called records.
Q4. State the relationship and difference between
a primary and foreign key.
Ans. Primary key and Foreign key are used to relate the tables so that
data can be fetched from multiple tables.
We can not enter duplicate values in Primary key while duplicate
values can be entered in Foreign Key.
Q7. List datatypes available in Numeric Datatype?
Ans. The different types of numeric data types are:

Boolean
Tinyint
Smallint
Integer
Bigint
Numeric
Decimal
Real
Float
Double

Q8. List datatypes available in Alphanumeric Data


Type?
Ans. The different types of Alphanumeric Data Type are:
Longvarchar
Char
Varchar
Varchar_Ignore Case
Q9. Define the structure of a table.
Ans. A table is a set of data elements (values) that is organized in
vertical columns and horizontal rows. A table has a defined number of
columns, but can have any number of rows.
Q10. Differentiate between Tuples and Attributes
of a table.
Ans. A row also called a Record or Tuple represents a single, data item
in a table. Whereas A column is a set of data values of a particular
simple type, one for each row of the table.
Q11. Name different Binary data types.
Ans. The different Binary data types are:
1. Longvarbinary
2. Binary
3. Varbinary
Q12. What is the file extension for databases
created using OpenOffice.Org Base?
Ans. The extension is .odb
Q13. List any three file formats that can be
managed using OpenOffice.Org Base?
Ans. Three file formats that can be managed using OpenOffice.Org
Base.
1. .odb
2. .odf
3. .odt

Q14. How many types of relationships can be


created in Base? Explain each of them.
Ans. There are three types of relationship in OpenOffice Base.
ONE to ONE : In this relationship, both the tables must have primary
key columns. Example: In the given tables EMP and DEPT, EMP_ID in
EMP table and DEPT_ID in DEPT table are the primary keys.
ONE to MANY : 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.
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.
Q15. What do you mean by Sorting? In how many
ways it can be done?
Ans. Sorting means arranging elements in particular sequence. It can
be done in two ways.
1. Increasing order
2. Decreasing Order
Q16. Explain Referential Integrity with the help of
an example.
Ans. 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.

for example we have two tables :

Student table has fields Admno, Name, Fname , Mname (Admno is a


primary Key)

Teacher table has fields T_id, Admno, Tname, Tsal (T_id is primary key
and Admno is Foreign Key)
Both the above tables can be linked by Common Fields ie Admno
Q17. Name DML commands.
Ans. DML stands for Data Manipulation Language. DML Commands
are :
SELECT – retrieve data from a database.
INSERT – insert data into a table.
UPDATE – updates existing data within a table.
DELETE – deletes all or specific records from a table.
Q18. What is the purpose of using queries?
Ans. The purpose of using query is to collect specific information
from the pool of data(TABLE). A query also helps us to extract
information from different tables.
Q19. Which clause of the Select statement helps
to display specific data?
Ans. „Where‟ clause of the Select statement helps to display specific
data.
Q20. Differentiate between Where and Orderby
clause of SQL statements.
Ans. Where clause helps to retrieve specific row from the table and
ORDER BY clause specifies an order in which to return the rows.
Q21. State the purpose of Update Command with
the help of an example.
Ans. Update statement is used for modifying records in a table. for
example the following command will increase the salary of all
employees by Rs 2000.
Update emp set sal = sal + 2000;
Q22. Why is there a need to create Forms?
Ans. 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.
Q23. What is the purpose of creating Reports?
Ans. A report helps to display the data in a summarized manner. It is used to
generate the overall work outcome in a clear format. We can create reports in
OpenOffice Base using wizard.

Q24. What are the prerequisites to create a Form


and Reports?
Ans. Table must be created and selected before creating forms and
reports in OpenOffice Base.
Q25. Differentiate between Forms and Reports.
Forms Reports

A form provides an interface that allows


users to enter, change and view the data in a Reports are used to present data from tables
database table. Forms are made up of elements or queries in a format that can be printed.
such as textboxes and labels.

We can make changes to data. We can not make changes to the data.
Q26. Can a form display data from queries?
Ans. Yes
Q27. In how many ways Forms and Reports can
be created in a database?
Ans. Forms and Reports can be created in two ways:
1. Create Form in design View
2. Create Form using wizard
Q30. In how many ways you can create query in
Open Office Base?
Ans. We can create query in Open Office Base by three ways which are :
1. Create query in Design view
2. Create query using Wizard
3. Create query in SQL view

Q31. Name the Query language which is used in


Base?
Ans. SQL

Q32. Which command is used to retrieve data


from the table?
Ans. Select command is used to retrieve data from the table.

Q33. Name two categories of SQL Commands.


Ans. Two categories of SQL Commands are :
1. DDL
2. DML

Q34. Differentiate between DDL and DML


Commands.
Ans.
DDL DML
It stands for Data Definition Language It stands for Data Manipulation Language

Example : Create, Alter, Drop Example : Insert, Update, Delete

Q35. Identify the DML Commands from the


following :
1. Create
2. Alter
3. Insert
4. Delete
Ans. Insert and Delete are DML Commands

Q36. __________ is the most commonly used Data


Manipulation Language(DML) command.
Ans. Select

Q37. Name two clauses which can be used with


Select Command.
Ans. Two clauses which can be used with Select Command are :
1. Where Clause
2. Order By Clause

Q38. Write the Select command to display all the


records of table “book”.
Ans. Select * from book;

Q39. Write the shortcut to execute query in


“Create query in SQL view” of Base.
Ans. F5

Q40. What is the purpose of Where clause in


Select Command?
Ans. Where Clause is used to retrieve specific record from the table.
Q41. What is the purpose of Order by clause in
Select Command?
Ans. Order by clause is used to arrange the records in ascending or descending
order.

Q42. Write the queries for the following table :


Emp
Emp_id Ename Salary

1 Suman 20000

2 Sanjay 32000

3 Ravi 30000

Q43. Display the salary of all the employees after


incrementing by Rs 1000.
Ans. Select Salary +1000 from Emp;

Q44. Display the Employee id and salary of all the


employees after decreasing by Rs 500.
Ans. Select Emp_id, Salary – 500 from Emp;

Q45Display the Name and salary of all the


employees after incrementing it as thrice the
amount of present salary
Ans. Select Ename, Salary * 3 from Emp;

Q 46 Display the Employee id, Name and salary of


all the employees after decrementing it as half
the amount of present salary.
Ans. Select Emp_id, Ename, Salary/2 from Emp;
Q 47 Display the Employee id and Name of all the
employees.
Ans. Select Emp_id, Ename from Emp;

Q 48. Write the queries for the following table :


Student
Admno Name Class House

1001 Sonam 9 Blue

1002 Ravi 10 Yellow

1003 Poonam 10 Green

Q 49 Display the entire table


Ans. Select * from Student

Q 50 Display the list of students whose house


color is blue.
Ans. Select * from Student where House = “Blue”

Q51.Display the admission number of students


whose house color is green.
Ans. Select Admno from Student where House = “Yellow”

Q 52 To view records in ascending order of


Admission Number.
Ans. Select * from Student order by Admno Asc;

Q53.Display the records of Class 10 Students.


Ans. Select * from students where Class = 10;

Q54 Display the class of „Ravi‟


Q55 Insert the given record : 1004, “Aman”, 11,
“Blue”
Ans. Insert into Student values( 1004, “Aman”, 11, “Blue”)

Q56. Which command is used for the following


task in database?
1. To insert a new record
2. To modify the existing data.
3. To delete a record
4. To display record
Ans.
1. Insert
2. Update
3. Delete
4. Select

Q57. Write the queries for the following table :


Item
Itemno Iname Price Qty

12 Pen 10 17

13 Eraser 5 15

14 Notebook 15 20

Q58 Write a query to insert a new record of


following details
15, “Pencil”, 20, 10
Ans. Insert into Item values(15, “Pencil”, 20, 10)

Q59 Write a query to display detail of items


whose quantity is more than 10.
Ans. Select * from Item where Qty > 10
Q60 Write a query to change the quantity of Item
number 13 to 25.
Ans. Update Item set Qty = 25 where Itemno = 13

Q61 Display the total amount of each item. The


amount must be calculated as the price
multiplied by quantity for each item
Ans. Select Price * Qty from Item.

Q62 Display the name of item whose price is 10.


Ans. Select Iname from Item where price = 10

Q63 Display all the records in ascending order of


price.
Ans. Select * from Item order by Price asc.

Q64 Identify the Primary key from table Item.


Ans. Itemno

Q65 Write the suitable data type of field “Iname”.


Ans. Char or Varchar

Q66Write a query to increase the price of all


items by Rs2.
Ans. Update Item set Price = Price + 2;

Q67.Write a query to decrease the price of all


items by Rs2 whose price is less than 20.
Ans. Update Item set Price = Price – 2 where Price < 20;

Q68. By default, data is arranged in


_________ order using ORDER BY clause.
Ans. Ascending Order
Q69. Which clause is used for the following:
a. To display specific record.
b. To display records in a particular order.
Ans.
1. Where Clause
2. Order by Clause

Q70. What is Form in OpenOffice Base?


Ans. A form provides the user a systematic way of storing information into the
database.

Q71. Name the interface which lets users to view,


enter, and change data directly in database.
Ans. Form

Q72. Write two ways of creating form in Open


Office Base.
Ans. Two ways of creating form in Open Office Base are :

a. Create form in design view


b. Use Wizard to create form

Q73. Can we enter the data in table using forms?


Ans. Yes

Q74. What do you mean by Report in Open


Office Base?
Ans. A report helps to display the data in a summarized manner. It is used to
generate the overall work outcome in a clear format.
Q75. Differentiate between Forms and Report.
Ans.

Form Report

1. It is a way of storing data into a database It is a way to display data in a printed form.

2. Values entered in the form can be modified Values in the report can not be modified.

Q76. Name the two types of report created in


OpenOffice Base.
Ans. Two types of report created in OpenOffice Base are:

a. Static Report
b. Dynamic Report

Q77. What do you mean by static report?


Ans. A report which do not show any change if we make any changes in the data
of the table.

Q78. What do you mean by dynamic report?


Ans. A report which shows the corresponding changes which we make in the
data of the table.

Q79. Can we enter records by report?


Ans. No

You might also like