0% found this document useful (0 votes)
27 views

DBMS Questions

DBMS questions
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
27 views

DBMS Questions

DBMS questions
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 14

Data Base Management System :

1. What do you mean by RDBMS?


RDBMS stands for Relational Database Management System. It is a database management
system which is based on relational model. When data is to be stored, maintained, and retrieved
from multiple tables then special database software are required known as RDBMS.

2. Define the following terms :


1 Table 2. Fields 3. Records
Table : A table is a set of data elements that is organized in vertical columns and horizontal rows.
Fields : A field is a set of data values of a particular simple type, one for each row of the table.
Records : A row also called a Record or Tuple represents a single, data item in a table.
3. What are the two ways of creating table in OpenOffice Base.
Ans. Two ways of creating table in OpenOffice Base are :
a. Create table in design view b. Use Wizard to create table.
4. What do you mean by Data type? Give example of two data type used in OpenOffice
Base.
Datatypes are used to identify which type of data (value) we are going to store in the database.

Decimal, Boolean, SmallInt


5. Identify the data type in which we can store the decimal value
a. Boolean b. TinyInt c. Decimal d. Real
e. Double f. Smallint
Ans. Data types in which we can store the decimal value are :
c. Decimal d. Real e. Double
6. What is the difference between Char and Varchar data type?
Ans. Char is a fixed length data type and Varchar is a variable length data type.
7. Write the data type suitable for the following fields.
a. DateofBirth b. Name c. Rollno d. Class e. Email f. City
a. DateofBirth – Date b. Name – Char or Varchar
c. Rollno – TinyInt / Smallint / Integer d. Class – Char / Varchar
e. Email – Char or Varchar f. City – Char or Varchar
8. Write four data types available in Alphanumeric Data types.
Ans. Four data types available in Alphanumeric Data types :
1. LongVarchar
2. Char
3. Varchar
4. Varchar_Ignorecase
9. Data in a (RDBMS) is organized in the form of Tables.
10. In RDBMS table is also known as Relation
11. Write four data types which are used to store numerical value.
Four data types which are used to store numerical value are
1. Smallint
2. Bigint
3. Integer
4. Float
12. Write four appropriate field names and their data types to store record of student.
Ans. Four appropriate field names and their data types to store record of students are :
1 Name —————— Char / Varchar 2. Admno —————- Integer
3. Fees ——————–Float/Double 4. DOB ——————-Date
13. Write four appropriate field names and their data types to store record of book.
Ans. Four appropriate field names and their data types to store record of book are :
a. Author_name ————- Char / Varchar b. Price ———————– Float / Decimal /
Double
c. Class ———————– Char / Varchar d. Subject ———————Char / Varchar
14. What is the default data type of a field while creating table in design view? Varchar
15. Tables are the basic building blocks of a database.
16. Write the expanded form of SQL
SQL : Structured Query Language
17. A table has horizontal row and Vertical columns Vertical).
18. OpenOffice Base is an open source RDBMS
19. Database wizard helps you to create a new database.
20. Multiple tables can be created in a database.
21. What is database?
A database is an organized collection of data.
22. What is DBMS?
DBMS stands for Database Management system. It is a software that controls the creation,
maintenance and use of a database.
23. Name two DBMS Software.
Two DBMS Software are :
1 MySQL 2. Oracle 3. Microsoft SQL Server 4. Microsoft Access.
24. What is the difference between Flat file and Relational ?

Flat File Relational

Data is stored in a single table. Data is stored in multiple tables.

It is suitable for less amount of data. It is suitable for large amount of data

25. What do you mean by database servers?


Ans. Database servers are dedicated computers that hold the actual databases and run only the
DBMS and related software.
26. Write four advantages of database.
Ans. Four advantages of database are
1 It reduces Data Redundancy
2. It allows sharing of data.
3. It help to maintain data integrity.
4. It provides Data Security.
27. What do you mean by Data Redundancy?
Ans. Duplication of data in a database is known as data redundancy.
28. What do you mean by Data Integrity?
Ans. Data integrity means that the data is accurate and consistent in the database.
29. What is Data Consistency?
Ans. Data Consistency means there should be multiple mismatching copies of the same data in a
database.
30. Write two features of database.
Ans. Two features of database are :
1. A database can have one or many tables.
2. Every table in a database has a primary key field which ensures unique values in the database.
31. What is Primary Key?
Ans. A field which is unique for each and every record in a table is called primary key.
32. What do you mean by Composite Primary key?
Ans. When primary key constraint is applied on one or more columns then it is known as
Composite Primary Key.
33. What is Foreign Key?
Ans. A Foreign Key is a field in one table that refers to the primary key of another table. It is
used to link two tables.
Q15. Answer the following questions on the basis of following table:
Table : Student Table Teacher

Stud_id Stud_name Class Fees T_id T_name T_Sal Stud_id

1 Aman IX 3000 3210 Mr. Kumar 60000 1

2 Anil X 3200 3211 Mr. Sethi 70000 2

1. Identify the primary key in Student and Teacher table.


2. Identify the foreign key in Teacher table.
1. Primary Key in Student table : Stud_id Primary key in Teacher table is : T_id
2. Foreign key in Teacher table is : Stud_id
Q1. What do you mean by Datasheet View?
Ans. A view in which new data can be inserted and inserted data can be modified or removed in
a table is called datasheet view
Q2. What do you mean by design view?
Ans. A view in which we can change the structure of the table is called design view.
Q3. Write steps to open table in design view.
Ans. Steps to open table in design view are :
1. Open the Open Office Base
2. Right click on the table which we need to open.
3. Select option Edit from popup menu.
4. Required table will open in design view
Q4. What do you mean by Field Property in Base?
Ans. Those properties which determine the characteristics and behavior of fields are called field
property.
Q5. Name two properties of Numeric type data.
Ans. Two properties of Numeric type data are :
1. Auto Value
2. Length
Q6. Name two properties of Character type data.
Ans. Two properties of Character type data are :
1. Entry Required
2. Length
Q7. What is the default length of Integer data type?
Ans. The default length of Integer data type is 10.
Q8. What is the default length of Varchar data type?
Ans. The default length of Varchar data type is 50.
Q9. Define the following field properties in reference to Open Office Base.
1. Default Value
2. Format
3. Auto Value
Ans.
1. Default Value : A value which automatically appears when we enter the new record.
2. Format : This property helps to set the format of the data entered in the field.
3. Auto Value : This is the property of Numeric Field type. If this property is set to Yes then
numeric field will get auto numeric value.
Q11. What is Referential Integrity?
Ans. Referential Integrity is used to maintain the accuracy and consistency of data in
relationship.
Q13. How many types of relationship can be created between tables? Name them.
Ans. Three types of relationship can be created between tables.
1. One to One
2. One to Many or Many to One
3. Many to Many
Q14. Relationship option is available in Tool menu.
Q15. Write two advantages of relationship created between two tables.
Ans. Two advantages of relationship created between two tables are :
1. It reduces data entry errors.
2. It help to summarize data from related tables
16. What do you mean by query in Open Office Base?
17. In how many ways you can create query in Open Office Base?
18. Name the Query language which is used in Base?
19. Which command is used to retrieve data from the table?
20. Name two categories of SQL Commands.
Ans. Two categories of SQL Commands are :
1. DDL
2. DML
21. 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

22. Identify the DML Commands from the following :


1. Create
2. Alter
3. Insert
4. Delete
Ans. Insert and Delete are DML Commands
23. __________ is the most commonly used Data Manipulation Language(DML) command.
24. 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
25. Write the Select command to display all the records of table “book”.
Ans. Select * from book;
26. Write the shortcut to execute query in “Create query in SQL view” of Base.
Ans. F5
27. What is the purpose of Where clause in Select Command?
Ans. Where Clause is used to retrieve specific record from the table.
28. 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.
29. Write the queries for the following table : Emp
Emp_id Ename Salary

1 Suman 20000

2 Sanjay 32000

3 Ravi 30000

a. Display the salary of all the employees after incrementing by Rs 1000.


Ans. Select Salary +1000 from Emp;
b. Display the Employee id and salary of all the employees after decreasing by Rs 500.
Ans. Select Emp_id, Salary – 500 from Emp;
c. Display 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;
d. 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;
e. Display the Employee id and Name of all the employees.
Ans. Select Emp_id, Ename from Emp;
30. Write the queries for the following table : Student

Admno Name Class House

1001 Sonam 9 Blue

1002 Ravi 10 Yellow

1003 Poonam 10 Green

a. Display the entire table


b. Display the list of students whose house color is blue.
Ans. Select * from Student where House = “Blue”
c. Display the admission number of students whose house color is green.
Ans. Select Admno from Student where House = “Yellow”
d. To view records in ascending order of Admission Number.

Ans. Select * from Student order by Admno Asc;


e. Display the records of Class 10 Students.
Ans. Select * from students where Class = 10;
f. Display the class of ‘Ravi’
Ans. Select Class from Student where Name = ‘Ravi’
g. Insert the given record : 1004, “Aman”, 11, “Blue”
Ans. Insert into Student values( 1004, “Aman”, 11, “Blue”)
31. 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
32. Write the queries for the following table : Item

Itemno Iname Price Qty

12 Pen 10 17

13 Eraser 5 15

14 Notebook 15 20

a. Write a query to insert a new record of following details


15, “Pencil”, 20, 10
Ans. Insert into Item values(15, “Pencil”, 20, 10)
b. Write a query to display detail of items whose quantity is more than 10.
Ans. Select * from Item where Qty > 10
c. Write a query to change the quantity of Item number 13 to 25.
Ans. Update Item set Qty = 25 where Itemno = 13
d. 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.
e. Display the name of item whose price is 10.
Ans. Select Iname from Item where price = 10
f. Display all the records in ascending order of price.
Ans. Select * from Item order by Price asc.
g. Identify the Primary key from table Item.
Ans. Itemno
h. Write the suitable data type of field “Iname”.
Ans. Char or Varchar
i. Write a query to increase the price of all items by Rs2.
Ans. Update Item set Price = Price + 2;
j. 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;
33. By default, data is arranged in _________ order using ORDER BY clause.
Ans. Ascending Order
34. 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
35. What is Form in OpenOffice Base?
Ans. A form provides the user a systematic way of storing information into the database.
36. Name the interface which lets users to view, enter, and change data directly in
database.
Ans. Form
37. 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
38. Can we enter the data in table using forms?
Ans. Yes
39. 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.
40. Differentiate between Forms and Report.
.
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.

41. Reports in DBMS


42. 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
43. 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.
44. What do you mean by dynamic report?
Ans. A report which shows the corresponding changes which we make in the data of the
table.
45. Can we enter records by report?
No
BOOK SOLUTION :
A. Fill in the blanks.
1. A database is an organized collection of data.
2. A DBMS is a software package that can be used for creating and managing databases.
3. A RDBMS is a database management system that is based on the relational model.
4. Three popular DBMS software are Microsoft Access, OpenOfficeBase & MySQL.
5. A Primary Key is a unique value that identifies a row in a table.
6. Composite Key is a combination of one or more columns.
7. A table is a set of data elements that is organized using a model of vertical columns and
horizontal rows.
8. A column is a set of data values of a particular type, one for each row of the table.
9. A row represents a single, data item in a table.
10. Datatypes are used to identify which type of data we are going to store in the database.
11. Create table DDL command is used to create a table.
12. Common DDL statements are create, alter and drop.
13. The types of languages used for creating and manipulating the data in the Database are DDL
& DML.
14. A DDL is a standard for commands that define the different structures in a database.
15. A DML is a language that enables users to access and manipulate data in a database.
16. A Select is a part of DML involving information retrieval only.
17. A popular data manipulation language is SQL.
18. Tables are the basic building blocks of a database.
19. There are three types of Relationships in a table.
20. A form helps the user to systematically store information in the database.
21. A form enables users to view, enter, and change data directly in database objects such as
tables.
22. SELECT statement retrieves zero or more rows from one or more database tables or
database views.
23. By default, data is arranged in ascending order using ORDER BY clause.
24. UPDATE statement is used for modifying records in a database.
25. DELETE statement is used to remove one or more records in a Database.
26. To create a form you need to select the form option available under Database section.
27. A query helps to collect specific information from the pool of data in the database.
28. Report is used to display the summary of data.
29. Forms are the interfaces with which the user interacts.
30. Data from multiple tables can be linked with the help of Primary Key and Foreign Key
constraints.
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.
Q5. In how many ways tables can be created in Base?
Ans. Tables can be created in two ways.
1. In Design view
2. Using Wizard
Q6. Why are data types used in DBMS /RDBMS?
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

You might also like