0% found this document useful (0 votes)
90 views20 pages

Unit3 Database Management System

Uploaded by

Jay
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)
90 views20 pages

Unit3 Database Management System

Uploaded by

Jay
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/ 20

STD : 10 SUB : IT-402

DATABASE MANAGEMET SYSTEM ( W/S-1)


(1) What do you mean by data?
Ans. According to database, data is the single item stored in
database either individually or as a set. In database primarily data
is stored into database table which are organized into columns
having specific datatype.
e.g. A student table having roll_no column has integer datatype
then it can store only numerical values

(2) what do you mean by database?


Ans. Database is a collection of related data from which users can
efficiently retrieve the desired information. In database data can
be stored in a simple tabular form or a complex collection of
images, audio or video.

(3) What is difference between data and information?


Ans.
• Data is an individual unit that contains raw material which
does not carry any specific meaning. E.g. simple number
• Information is a processed, organized data presented in a
given context and is useful. It is a group of data that
collectively carry a logical meaning. E.g. Phone Number

(4) Explain DBMS with example?


Ans. A database management system is a software that enables
users to create, maintain and control all the access to the
database. . It is a collection of data records, files and other
objects. It provides an environment for users to retrieve and
store information and to allow different user application
programs to concurrently access the same database
e.g Oracle , Microsoft SQL Server , Microsoft Access , FoxPro

(5) Write the advantages of the Database Management System


Ans.
• The ability to update and retrieve data : database allows
adding new records, deleting existing records and changing
information within a record.
• Support concurrent updates: multiple users can update
database simultaneously
• Recovery of Data: Backup and recovery of data is possible
• Security : provides features for security e.g. encryption ,
authentication
• Data Integrity : incorrect data can not be stored
• Controlled data redundancy : data stored at the central
location , this removes replication of data in different files
• Data sharing : data can be shared among different users or
application programs
• Application development is easy : it can be designed
according to user’s need

(6) Write two types of the database? What is difference


between them ?
Ans. There are two types of database according to data being
organized
• Flat File database : data is stored in a single table. Used for
less amount of data.
• Relational database : data is stored in multiple tables and
tables are linked using common field. It is used for medium
or large amount of data.

(7) What do you mean by database server?


Ans.
• Database servers are dedicated computers that hold the actual
databases and run only the DBMS and related software.
• 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.

(8) What are the features of database?


Ans.
• A database can have one or many tables.
• Each table in database contains information and other objects
manages how they can be used
• Important feature is the record uniqueness in the table using
primary key

(9) what is RDBMS?


Ans. A relational Database Management system is the one type of
database in which data is stored, maintained and retrieved from
multiple tables . In RDBMS data can be integrated using keys like
Primary key , composite key and Foreign key
(10) How data is organized in RDBMS ? explain with example ?
Ans. In RDBMS data is organized into tables having rows and
columns. The individual cell in which a particular row and column
intersect is called a field
E.g. we create two tables , one for client and another for sales. In
client table client_id field will remain unique as it identify specific
client. In sales table we will use client_id field multiple times
whenever client place order. Here client is called as parent table and
sales as child table and we can establish relation between them using
primary key , composite key and foreign key.

(11) Define Primary key , composite key and foreign key


Ans.
• Primary key: it is a field in a table that uniquely identifies a row
( record ) in a table. It must contain unique value and cannot
have null value. A table can have only one primary key
• Composite key: when multiple fields are used as a primary key
then it is known as Composite Key. It is a combination of 2 or
more columns.
• Foreign key: the foreign key identifies a column or set of
columns in one (referencing) table that refers to a column or
set of columns in another (referenced) table. The “one” side of
a relation is always the parent, and provides the PK attributes
to be copied. The “many” side of a relation is always the child,
into which the FK attributes are copied.

(12) State the relationship between primary key and foreign key
Ans. A primary key – foreign key relationship defines a one to many
relationships between two tables in RDBMS . A foreign key is a
column or set of columns in one table that references the primary
key columns in another table.

(13) Difference between primary key and foreign key


Ans.
Primary key Foreign key
1. Primary key uniquely identify a Foreign key is a field in the
record in the table table that is primary key in
another table
2. It can’t accept null value It can accept null value
3 Primary key is index and data Automatically it does not
is organized in the sequence of create index ,
index
4 We can have only one primary We can have multiple
key in the table primary key in the table.

(14) Explain candidate key and Alternate key ?

Ans.

• Candidate key : When a table has more than one attribute


(column) that can serve as a primary key. Then this column or
set of columns is called candidate key. From candidate key we
can choose any one column as a primary key
• Alternate Key : The Candidate key which is not chosen as a
primary key is called as alternate key
(15) Define Table , attribute , tuples , degree and cardinality ?

Ans.

• Table : In a database table is a collection of data related to a


single topic. A table has defined number of columns and
number of rows . Each row is identified by unique key called
primary key.
• Attribute : (attribute / field / column) It is the vertical part of
table having particular data type e.g. in Student table
First_Name , Last_Name are fields
• Tuples : (Tuples / record / row ) it is the horizontal prat of table
and each row represents a set of related data . every row in the
table has the same structure.
• Degree : The number of columns in a table is called degree of
the table.
• Cardinality : The number of rows in the table is called its
cardinality.
STD : 10 SUB : IT-402
DATABASE MANAGEMET SYSTEM ( W/S-2)
(16) In how many ways tables can be created in Base?
Ans.
• Use Wizard to create database
• Create Database in Design View

(17) Explain data types? Why are data types used in DBMS /RDBMS?

Ans. Datatypes are used to identify which type of data or value we


are going to store in database. Fields can be of different data types
depending on the data they contain.
In open office Base , data types are divided into five parts
• Numeric types
• Alphanumeric types
• Binary types
• Date time
• Other variable types

(18) How can you create table using design view?


Ans.
• In the open office Base , under Task select Table > Use Wizard
to create Table option
• Specify the field name and data type of the field to be created
• Save the table by clicking on File > save, by default Table name
is Table1
• There will be message to set the primary key for the table , we
can set the primary key or it will set automatically by
application

(19) Define the structure of a table.


Ans.
• A table is a set of data elements organized using vertical
columns 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 primary key.
• Column is the set of data values of particular data type
• Each row represents single data item in table and each row has
same structure
• No of columns is called degree of the table
• No of rows is called cardinality of the table

(20) List datatypes available in Numeric Datatype?


Ans.
(21) List datatypes available in Alphanumeric Datatype?
Ans.

(22) Differentiate between Tuples and Attributes of a table.


Ans.

Tuples Attributes
1 It is row in table and also It is column in table and also
called as record called as field
2 It is set of data value of It is the collection of information
particular data type about the columns of table for
single instance

(23) Name different Binary data types.


Ans.
(24) What is the file extension for databases created using
OpenOffice.Org Base?

Ans. File extension for database created using open office Base is
*.odb

(25) List any three file formats that can be managed using
OpenOffice.Org ?

Ans.
Document type Application Extension
Presentation Template Impress *.odp
Word processor writer *.odt
Spreadsheet Calc *.ods

(26) How can you insert data in a table ?

Ans. To insert data in a table


• Select the table and double click on it
• The table will open in Datasheet view , here data can be
inserted , updated or deleted.

(27) How can you edit record in the table ?

Ans. To edit the data in the table click on Edit data icon or double
click on the data in the cell

(28) Explain any 4 field Properties?


Ans. In design view fields have different properties according to the
data type selected
• Auto Value : If set yes then field will get the auto numeric
values
• Length : default length is 10 but it can be set to maximum value
• Default Value : it can be set for field if user does not provide
any value while entering record
• Format Example : helps to set the format of the data entered in
the field

(29) What do you mean by Sorting? In how many ways it can be


done?

Ans. Sorting menace to arrange data in either ascending order or


descending order
Data can be sorted in two ways
• Manually : By using drag and drop
• Automatically : Select the columns then click on sort buttons ,
the data will be displayed accordingly

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

(31) How many types of relationships can be created in Base? Explain


each of the them.

Ans. There are 3 types of relations that can be created in tables


• one to one : Both the tables must have primary key column
• one to many or many to one : One of the table must have
primary key column. And it can be associated with any column
of the another table
• Many to Many : no table has primary key column. Here all the
columns of primary key table can be associated with all the
columns of associated table

(32) how can we remove relationships applied on tables ?


Ans. The relationships applied on table can be removed with the help
of Delete Option or Right click on relationship thread and select
delete option.
STD : 10 SUB : IT-402
DATABASE MANAGEMET SYSTEM ( W/S-3)
(33) What do you mean by filtering?
Ans. Filtering means , while extracting data from table hiding some
data and presenting only what we want

(34) What is the purpose of using queries?


Ans. A database query is used to access data of the table or to
modify structure of the table. Query can be used to retrieve, insert,
update or delete data from the table. Using query data can be
retrieve from one table or more tables

(35) Write difference between DDL and DML commands


Ans.
DDL Command DML Command
1. it is known as Data definition It is known as Data
language or Data description Manipulation Language
language
2. These commands are used to These commands are used
define, modify or remove the to access and manipulate
structure of various objects of data in a database
database e.g. Table
3. e.g. CREATE , ALTER , DROP e.g. SELECT , INSERT ,
UPDATE , DELETE

(36) Explain some DML commands


Ans.
• SELECT : to retrieve data from database
• INSERT: To insert data in a table
• UPDATE: Updates existing data in a database
• DELETE: Deletes record from the table according to condition

(37) Which clause of Select statement helps to display specific data?


Ans. To display records containing same type of values “WHERE”
clause can be used with the select SQL Command
To get the list of students whose favourite colour is blue, the
command is ,
Select * from Student_Details where colour = ‘Blue’;
Here table name = Student_Details
Field name = colour

(35) Differentiate between Where and Order by clause of SQL


statements.
Ans.
• The SQL Order by clause is used to sort the data in ascending or
descending order based on one or more columns. The columns
used for sorting should be in the table
• The SQL Where clause is used to specify a condition while
retrieving data from a single table or multiple tables. If the
given condition is satisfied then only it returns specific records
from the table.
(36) State the purpose of Update Command with the help of an
example.
Ans. The SQL Update query is used to modify the existing records in a
table. We can use where clause with the update query to update the
selected rows, otherwise all the rows would be updated.
e.g. Customer table has following records
ID NAME AGE ADDRESS SALARY
1 RAMESH 16 SURAT 20000
2 JAY 20 DELHI 15000

The following query will update the ADDRESS for a customer whose
ID is 2
UPDATE Customer SET ADDRESS = ‘PUNE’ where ID = 2;
(37) a) The structure of a table “ITEM” is given below. Suggest
suitable data type and size of each column.

Column name Type Size


Itemno ____________ ______
Iname ____________ ______
Price ____________ ______
Quantity ____________ ______
Ans.
Itemno integer (10)
Iname varchar(15)
Price decimal(5,2)
Quantity integer(3)

(38) Consider the following table “ITEM”:


Table: Item
Itemno Iname Price Quantity
11 Soap 40 80
22 Powder 80 30
33 Face cream 250 25
44 Shampoo 120 100
55 Soap box 20 50

Write queries to
i. Display the total amount of each item. The amount must be
calculated as the price multiplied by quantity for each item.
ii. Display the details of items whose price is less than 50.

Ans.
i. Select price * quantity from item;
ii. Select * from item where price < 50;
(39) remember the syntax of different queries and do practice
(1) select * from <table name>;
(2) select field name from table name;
(3) select * from table name where condition;
(4) select * from table name order by fieldname ASC;
(5) select * from table name order by fieldname DESC;
(6) Select * from table name where condition order by asc/desc;
(7) insert into <table name> (comma separated list of fields) values
(comma separated list of values)
(8) update <table name> set <field name> = value where <criteria>
(9) Delete from <table name> where <criteria>
(10) create TABLE <table name> ( <field name> <datatype> , ….. );

(40) Why there is 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

(41) 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. You can
create reports in the database.
(42) What are the prerequisites ( things required ) to create a Form
and Reports?
Ans. Forms allows to View , Add , Delete and Modify data of table or
query
While Report represents data from table or query.

(43) Differentiate between Forms and Reports.


Ans.
Form Report
1. Form is primarily used for Report is used for presenting
entering data data
2 Form is also used for Report is used for displaying
displaying records but one whole records of table or query
record at a time
3 Data can be modified Data can not be modified
through the form through report
4 Form is designed to be Report are designed to be
used on screen printed

(44) Can a form display data from queries?


Ans. Yes
(45) In how many ways Forms and Reports can be created in a
database?
Ans.
Form:
• Design view: create the form specifying the record source ,
controls and control properties
• Wizard: The wizard will guide through steps to create a form
Report:
• Wizard: The wizard will guide through steps to create a Report
STD : 10 SUB : IT-402
DATABASE MANAGEMET SYSTEM ( W/S-4)
Fill in the blanks:
1. A __________ is an organized collection of data.
Ans. Database

2. A ________________ is a software package that can be


used for creating and managing databases.
Ans. Database Management system

3. A ____________ is a database management system that is


based on the relational model.
Ans. RDBMS

4.Three popular DBMS software are ________, ________, &


_______.
Ans. Oracle , MS Access , MySQL

5. A ____________ is a unique value that identifies a row in a


table.
Ans. Primary Key

6. Composite Key is a combination of ________ columns.


Ans. One or many

7. A table is a set of data elements that is organized using a


model of vertical ___________ and horizontal
____________.
Ans. Columns , rows
8. A _________ is a set of data values of a particular type,
one for each row of the table.
Ans. Column or field or attribute

9. A ___________ represents a single, data item in a table.


Ans. Row or record or tuple

10. _____________ are used to identify which type of data


we are going to store in the database.
Ans. Datatypes

11. There are ________ ways to create a table.


Ans. Different

12. Field properties can be set in both the ________ and


_________ .
Ans. Table and Form

13. The types of languages used for creating and


manipulating the data in the Database are ______________
& ______________.
Ans. DDL and DML

14. A _____________ is a standard for commands that define


the different structures in a database.
Ans. DDL ( Data Definition Language)

15. A ______________ is a language that enables users to


access and manipulate data in a database.
Ans. DML ( Data Manipulation Language)
16. A _____________ is a part of DML involving information
retrieval only.
Ans. SELECT statement

17. A popular data manipulation language is ____________


Ans. SQL language

18. ________ are the basic building block of a database


Ans. Tables

19. There are __________ types of Relationships in a table.


Ans. three

20. A _______ helps the user to systematically store


information in the database.
Ans. Form

21. A ________ enables users to view, enter, and change


data directly in database objects such as tables.
Ans. Form

22. _________ statement retrieves zero or more rows from


one or more database tables or database views.
Ans. Select statement

23. By default, data is arranged in _______ order using


ORDER BY clause.
Ans. Ascending order

24. __________ statement is used for modifying records in a


database.
Ans. Update statement

25. __________ statement is used to remove one or more


records in a Database.
Ans Delete statement

26. __________statements are used to add, delete or to


modify columns already existing in a database
Ans. Alter statement

You might also like