You are on page 1of 5

Class - XI Subject - IT Teacher - Ms.

Neelam Mehla

Part-B Unit-4
Relational Database Management System
Exercise
1. Write a short note on MySQL.
Ans. Introduction to MySQL: MySQL is a relational database management system
(RDBMS). It is pronounced as "My Sequel". MySQL was originally founded and
developed in Sweden by David Axmark, Allan Larsson and Michael Widenius, who
had worked together since the 1980s.

2.Mention features of a DBMS.


Ans. Features of DBMS:
i. Store data in a structured way.
ii. Query the database (that is, ask questions about the data) ·
iii. Sort and manipulate the data in the database ·
iv. Validate the data entered and check for inconsistencies ·
v. Produce flexible reports, both on screen and on paper, that make it easy to
comprehend the information stored in the database.

3.What is the difference between DBMS and RDBMS?


Ans.

DBMS RDBMS

i)DBMS stores data as file. i)RDBMS stores data in tabular form.

ii)Multiple data elements can be accessed at the same

ii)Data elements need to access individually. time.

iii)Data is stored in the form of tables which are

iii)No relationship between data. related to each other.

iv)Normalization is not present. iv)Normalization is present.

v)DBMS does not support distributed

database. v)RDBMS supports distributed database.


DBMS RDBMS

vi)It uses a tabular structure where the headers are

vi)It stores data in either a navigational or the column names, and the rows contain

hierarchical form. corresponding values.

vii)It deals with small quantity of data. vii)It deals with large amount of data.

viii)Data redundancy is common in this

model. viii)Keys and indexes do not allow Data redundancy.

ix)It is used for small organization and deal

with small data. ix)It is used to handle large amount of data.

x)It supports single user. x)It supports multiple users.

xi)Data fetching is slower for the large

amount of data. xi)Data fetching is fast because of relational approach.

xii)The data in a DBMS is subject to low

security levels with regards to data xii)There exists multiple levels of data security in a

manipulation. RDBMS.

xiii)Low software and hardware necessities. xiii)Higher software and hardware necessities.

xiv)Examples: MySQL, PostgreSQL, SQL Server, Oracle,

xiv)Examples: XML, Microsoft Access, etc. etc.

4.List some features of MySQL.


Ans. Features of MySQL:
i. MySQL is released under an open-source license so it is customizable.
ii. It requires no cost or payment for its usage. MySQL has superior speed, is
easy to use and is reliable.
iii. MySQL uses a standard form of the well-known ANSI-SQL standards.
iv. MySQL is a platform independent application which works on many
operating systems like Windows, UNIX, LINUX etc. and has compatibility with
many languages including JAVA, C++, PHP, PERL, etc.
v. MySQL is an easy to install RDBMS and is capable of handling large data sets.

5.How is Primary Key different from Candidate Key?


Ans. Primary Key: The group of one or more columns used to uniquely identify each
row of a relation is called its Primary Key.
Candidate Key: A column or a group of columns which can be used as the primary key
of a relation is called a Candidate key because it is one of the candidates available to be
the primary key of the relation.

6.Define the key(s) used in MySQL.


Ans.
i. Primary Key: The group of one or more columns used to uniquely identify each row of a
relation is called its Primary Key.
ii. Candidate Key: A column or a group of columns which can be used as the primary key
of a relation is called a Candidate key because it is one of the candidates available to be
the primary key of the relation.
iii. Alternate Key: A candidate key of a table which is not selected as the primary key is
called its Alternate Key.
iv. Foreign Key: A primary key of a base table when used in some other table is called as
Foreign Key.

7.State the similarity and difference between the Primary Key, Candidate
Key, Alternate Key and Foreign Key.
Ans.
i. Primary Key: The group of one or more columns used to uniquely identify each row of a
relation is called its Primary Key.
ii. Candidate Key: A column or a group of columns which can be used as the primary key
of a relation is called a Candidate key because it is one of the candidates available to be
the primary key of the relation.
iii. Alternate Key: A candidate key of a table which is not selected as the primary key is
called its Alternate Key.
iv. Foreign Key: A primary key of a base table when used in some other table is called as
Foreign Key.

8.Which statement is used to select a database and make it current?


Ans. Using a database
Syntax: USE <databasename>;
mysql> USE School;
Database Changed
Viewing the current database, we must know which database we are currently working
in, to see the name of the current database we use SELECT command.
Syntax: SELECT DATABASE();
School will be displayed.

9.How is a database related to table(s)?


Ans. In databases, and a table is a set of data elements (values) using a model of
vertical columns (identifiable by name) and horizontal rows, the cell being the unit
where a row and column intersect. A table has a specified number of columns, but can
have any number of rows.

10. Write SQL statement to view names of all the tables contained in the
current database.
Ans. Viewing the tables in the database To see a list of tables present in the current
database we will use SHOW TABLES.

Syntax: SHOW TABLES;


mysql> SHOW TABLES;
+------------------------+
Tables_in_school
+------------------------+

Learner
+-------------------------+
1 row in set (0.00 sec)

11.In a database there is a table Cabinet. The data entry operator is not
able to put NULL in a column of Cabinet? What may be the possible
reason(s)?
Ans. Many times there are some columns of a table in which NULL values should not
be accepted. We always want some known valid data values in these columns. So we
can set NOT NULL constraint in that column.

12. In a database there is a table Cabinet. The data entry operator is not
able to put duplicate values in a column of Cabinet? What may be the
possible reason(s)?
Ans. Because of UNIQUE key constraint.
13. Do Primary Key column(s) of a table accept NULL values?
Ans. No, Primary key column of a table not accept NULL values.
14. What are the differences between DELETE and DROP commands of
SQL?
Ans. DELETE is a Data Manipulation Language command, DML command and is used
to remove tuples/records from a relation/table. Whereas DROP is a Data Definition
Language, DDL command and is used to remove named elements of schema like
relations/table, constraints or entire schema.

15. Which statement is used to modify data in a table?


A. CHANGE
B. MODIFY
C. UPDATE
D. SAVE AS
Ans. UPDATE statement is used to modify data in a table.
16. Which SQL statement is used to delete data from a table?
A. DELETE
B. DROP
C. TRUNCATE
D. REMOVE
Ans. DELETE SQL statement is used to delete data from a table.

Fill up the blanks:


1. INSERT command is used to add records in a relation.
2. Select is a type of DDL command.
3. UPDATE command is used to modify records in a table.
4. LIKE Keyword is used to match string patterns.
5. BETWEEN operator includes UPPER Bound and LOWER Bound values
given in the range.

You might also like