0% found this document useful (0 votes)
9 views10 pages

Selfstudys Com File

Uploaded by

nk3471002
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)
9 views10 pages

Selfstudys Com File

Uploaded by

nk3471002
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/ 10

Chapter 2: Introduction to DBMS

EXERCISE [PAGES 28 - 29]

Exercise | 1.1 | Page 28

QUESTION

Tick whichever box is not valid.

Graphic

Date

Number

Text

SOLUTION

Graphic

Exercise | 1.2 | Page 28

QUESTION

Student wants to create a field pincode in a table, which data type he will choose?

SOLUTION

INT

Exercise | 1.3 | Page 28


QUESTION

Tick the appropriate box.

is also called foreign key

Uniquely identifies a record

SOLUTION

Uniquely identifies a record

Exercise | 1.4 | Page 28

QUESTION

Tick the appropriate circle.

Only one record

Only single table

One or many tables

None of these

SOLUTION

One or many tables


Exercise | 2 | Page 28

QUESTION

Observe the field names of a database given below in ‘Column A’ related to Bus
reservation. Write suitable data types for each field in front of the respective field in
‘Column B’

Column A (Field Name) Column B (Data Type)


Passenger Name

SOLUTION

Column A (Field Name) Column B (Data Type)


Passenger Name Text

Exercise | 2 | Page 28

Observe the field names of a database given below in ‘Column A’ related to Bus
reservation. Write suitable data types for each field in front of the respective field in
‘Column B’

Column A (Field Name) Column B (Data Type)


Gender

SOLUTION

Column A (Field Name) Column B (Data Type)


Gender Text

Exercise | 2 | Page 28

QUESTION

Observe the field names of a database given below in ‘Column A’ related to Bus
reservation. Write suitable data types for each field in front of the respective field in
‘Column B’

Column A (Field Name) Column B (Data Type)


Age

SOLUTION

Column A (Field Name) Column B (Data Type)


Age Int

Exercise | 2 | Page 28

QUESTION

Observe the field names of a database given below in ‘Column A’ related to Bus
reservation. Write suitable data types for each field in front of the respective field in
‘Column B’

Column A (Field Name) Column B (Data Type)


Mobile Number

SOLUTION

Column A (Field Name) Column B (Data Type)


Mobile Number Int

Exercise | 3 | Page 28

QUESTION

Write the use of following SQL command

INSERT

SOLUTION

Insert data into a table

Exercise | 3 | Page 28

QUESTION

Write the use of following SQL command

UPDATE

SOLUTION

Update data in a table

Exercise | 4 | Page 28

QUESTION

Create a table for the information given below by choosing appropriate data types.
Specify proper primary key for the table 1) Movie 2) Actor
1. Movie (Registeration_no, movie_name, Realease_Date)

2. Actor (actor_id, Actor_name, birth_date )

SOLUTION

Create table movie (


Registration_no smallint primary key,
movie_name varchar (20),
Release_Date date
);
Create table actor (
actor_id smallint primary key,
Actor_name varchar (20),
birth_date date
);

Exercise | 5.1 | Page 29

QUESTION

Consider the following table Stationary. Write SQL commands for following statement.

S_ID S_Name C_Name Price Quantity


001 Note Book ABC 20 50
002 Pencil Box XYZ 10 80
003 A4 Pages rim PQR 600 2

Write SQL command to create above Table

SOLUTION

Create table Stationary (


S_ID int primary key,
S_Name varchar (20),
C_Name varchar (20),
Price smallint,
Quantity smallint
);

Exercise | 5.2 | Page 29

QUESTION

Consider the following table Stationary. Write SQL commands for following statement.
S_ID S_Name C_Name Price Quantity
001 Note Book ABC 20 50
002 Pencil Box XYZ 10 80
003 A4 Pages rim PQR 600 2

Write SQL command to insert above mentioned record in table

SOLUTION

INSERT INTO Stationary values


(001, 'Note Book', 'ABC', 20, 50)
(002, 'Pencil Box', 'XYZ', 10, 80)
(003, 'A4 Pages rim', 'PQR', 600, 2);

Exercise | 5.3 | Page 29

QUESTION

Consider the following table Stationary. Write SQL commands for following statement.

S_ID S_Name C_Name Price Quantity


001 Note Book ABC 20 50
002 Pencil Box XYZ 10 80
003 A4 Pages rim PQR 600 2

To delete above table.

SOLUTION

DROP table Stationary;

Exercise | 6.1 | Page 29

QUESTION

What is a database?

SOLUTION

A DBMS is a collection of programs (computer based system) that enables the user to
create and maintain a database it is used to define, construct and manipulate the data
in the database for various applications. It provides information storage, organization
and retrieval capabilities. The DBMS also enforces necessary access restrictions and
security measures in order to protect the database. Various types of control systems
within the DBMS make sure that the database continues to function properly.
They Include Integrity system Security system Concurrency control system Recovery
control system Some DBMS enable us to define “views” of the database. A view is how
the database appears to the user. This enables us to show only the relevant information
to different types of users and it increases security, as certain users will not be able to
see data which they are not meant to see.

Exercise | 6.2 | Page 29

QUESTION

What are the advantages of a DBMS?

SOLUTION

Redundancy is controlled: In File Processing System, duplicate data is created in


many places because all the programs have their own files. This creates data
redundancy which in turns wastes labor and space. 'In Database Management System,
all the files are integrated in a single database. The whole data is stored only once at a
single place so there is no chance of duplicate data.

Sharing of Data: In a database, the users of the database can share the data among
themselves. There are various levels of authorization to access the data. And
consequently the data can only be shared based on the correct authorization protocols
being followed.

Data Security: Data Security is vital concept in a database. Only authorized users
should be allowed to access the database and their identity should be authenticated
using a username and password. Unauthorized users should not be allowed to access
the database under any circumstances as it violates the integrity constraints.

Enforces integrity constraints: Constraints are used to store accurate data because
there are many users who feed data in database. Data stored in database should always
be correct and accurate. DBMS provides the capability to enforce these constraints on
database.

Provides backup and recovery of data: Data loss is a very big problem for all the
organizations. In traditional tile processing system, a user needs to backup the database
after a regular interval of time that wastes lots of time and resources._If the volume of
data is large then this process may take a very long time.

Exercise | 6.3 | Page 29

QUESTION

What do you understand by Data Model?

SOLUTION

A Database model defines the logical design and structure of a database and defines
how data will be stored, accessed and updated in a database management system.
While the Relational Model is the most widely used database model.

Relational Model:

It is the most popular data model in DBMS. Relational model is the primary data model.
Which is widely used for data processing. This model has all properties required to
Process data with storage efficiency.

Exercise | 6.4 | Page 29

QUESTION

What is a primary key?

SOLUTION

Primary Key: A column in the table that uniquely identifies each row in that table is
called a primary key.

Exercise | 6.5 | Page 29

QUESTION

What is DDL (Data Definition language)?

SOLUTION

DDL statements or commands are used to define and modify the database structure of
your tables or schema. When you execute a DDL statement, it takes effect immediately

Some examples of DDL commands are CREATE, ALTER and DROP

Exercise | 7 | Page 29

QUESTION

In a company the data is stored in a table under the following fields Employee number,
Last name, Date of birth, Address. Which data type will you use for the above field.
SOLUTION

Employee number: INT

Employee Name: VARCHAR

Last Name: VARCHAR

Address: VARCHAR

Date of Birth: DATE

Exercise | 8.1 | Page 29

QUESTION

Complete the following.

To remove access rights or previleges from the database

SOLUTION

REVOKE

Exercise | 8.2 | Page 29

QUESTION

Complete the following.

Extracts data from a table


SOLUTION

SELECT

You might also like