You are on page 1of 11

INTRODUCTION TO DATABASE

CHAPTER 3
MANAGEMENT SYSTEM

Namma Kalvi
9. Which is the MySQL instance responsible for
www.nammakalvi.org data processing?
a) MySQL Client b) MySQL Server
PART II
c) SQL d) Server Daemon Program

Choose the Correct Answers 10. The structure representing theorganization-


al view of entire database is known as ____
1. Which language is used to request in MySQL database.
­information from a Database? a) Schema b) View
a) Relational b) Structural c) Instance d) Table
c) Query d) Compiler
ANSWERS FOR OBJECTIVES
2. The ______ diagram gives a logicalstructure
1. c 2. a 3. b 4. c 5. c
of the database graphically?
6. a 7. b 8. a 9. c 10. a
a) Entity-Relationship b) Entity
c) Architectural Representation d) Database
PART III
3. An entity set that does not have enough
­attributes to form primary key is known as Short Answers
a) Strong entity set b) Weak entity set
c) Identity set d) Owner set 1. Define Data Model and list the types of data
model used.
4. _____ Command is used to delete a ­database.
™™ Hierarchical Database Model
a) Delete database database_name
™™ Network model
b) Delete database_name
™™ Relational model
c) drop database database_name
™™ Object-oriented database model
d) drop database_name
2. List few disadvantages of file processing
5. Which type of below DBMS is MySQL?
system.
a) Object Oriented b) Hierarchical
Data Duplication - S
 ame data is usedby multiple
c) Relational d) Network
resources for processing, thus
6. MySQL is freely available and is open source. created multiple copies of same
a) True b) False datawasting the spaces.
High Maintenance -  Access control andverifying
7. ________ represents a “tuple” in a r­ elational data consistency needs high-
database? maintenance cost.
a) Table b) Row Security - Less security provided to the data.
c) Column d) Object
3. Define Single and multi valued attributes.
8. Communication is established with MySQL ™™ A single valued attribute contains only one ­value
using for the attribute and they don’t have multiple
a) SQL b) Network calls numbers of values.
c) Java d) API’s ™™ A multi valued attribute has more than one value
for that particular attribute.
SURYA 1
Chapter - 3  Introduction to Database Management System XII Std - Computer Application
4. List any two DDL and DML commands with 10. State few advantages of Relational
its Syntax. ­databases.
DDL Commands:   The DBMS provides users and programmers with
Commands Syntax a systematic way to create, retrieve, update and
CREATE CREATE database databasename manage data.”
DROP DROP database databasename;
PART IIII
DML Commands:
Commands Syntax Explain in Brief Answer
INSERT INSERT INTO tablename VALUES
(value1, value2, value3); 1. Explain on Evolution of DBMS.
DELETE DELETE from tablename WHERE ™™ The concept of storing the data started before 40
columnname=”value”; years in various formats.
™™ In earlier days they have used punched card
5. What are the ACID properties? technology to store the data. Then files were
™™ Atomicity used.
™™ Consistency ™™ The file systems were known as predecessor of
™™ Isolation database system.
™™ Durability. ™™ Variousaccess methods in file system were
6. Which command is used to make ­permanent indexed, random and sequential access.The
­
changes done by a transaction? file system had more limitations like Data
™™ These SQL commands manage thetransactions Duplication,High Maintenance, and Security.
in SQL databases. •• Data Duplication – Same data is used by
™™ It alsohelps to save the change into ­multiple resources for processing, thus ­created
databasepermanently. multiple ­copies of same data wasting the
™™ COMMIT, ROLLBACK,SET TRANSACTION and spaces.
SAVEPOINTcommands belongs to this category. •• High Maintenance – Access control and
verifying data consistency needs high
­
7. What is view in SQL? ­maintenance cost.
A set of stored queries is known as view in SQL. •• Security – less security provided to the data.
So database systems became popular to
8. Write the difference between SQL and
­overcome the above limitations of file system.
MySQL.
2. What is relationship in databases? List its
SQL MySQL types.
SQL is a query MySQL is database ™™ There exists a relationship between two tables
­language. ­software. when the foreign key of one table references
To query and Allows data handling, ­primary key of other table.
operate database ­storing, modifying, ­deleting ™™ The Entity- Relationship(ER) diagram is based on
system. in a tabular format. the three types listed below.
•• One-to-One relationship
9. What is Relationship and List its types. •• One-to-Many relationship
One-to-One relationship •• Many-to-Many relationship
One-to-Many relationship
Many-to-Many relationship 3. Discuss on Cardinality in DBMS.
™™ It is defined as the number of different values in
any given table column

2 SURYA
www.nammakalvi.org
XII Std - Computer Application Chapter - 3  Introduction to Database Management System
™™ It is defined as the number of items that must be Hierarchical Database Model
included in a relationship.ie) number of entities ™™ In this model each record has information in par-
in one set mapped with the number of entities of ent/child relationship like a tree structure.
another set via the relationship. ™™ The collection of records was called as record
™™ Three classifications in Cardinality are ­one-to-one, types, which are equivalent to tables in relational
one-to-many and Many-to-Many. model.
™™ The individual records are equal to rows.
4. List any 5 privileges available in MySQL for
™™ The famous Hierarchical database model was
the User.
IMS (Information Management System), IBM’s
Privileges Action Performed (If Granted) first DBMS.
Select_priv User can select rows from
­database tables. Advantages:
Insert_priv User can insert rows into database ™™ Less redundant data
tables. ™™ Efficient search
Update_priv User can update rows of database ™™ Data integrity
tables. ™™ Security
Delete_priv User can delete rows of database
tables. Limitations:
Create_priv User can create new tables in ™™ Complex to implement and difficulty in handling
database ™™ Many to many relationships.

5. Write few commands used by DBA to Network model


­control the entire database. ™™ Network model is similar toHierarchical model
™™ USE Database ­except that in thismodel each member can have
•• This command is used to select the database more thanone owner.
in MySQL for working. ™™ The many to many relationshipsare handled in a
  Syntax: mysql>use test; better way.
™™ SHOW Databases ™™ This modelidentified the three database
•• Lists all the databases available in the ­database components
server. •• Network schema - Defines all
  Syntax: mysql>show databases; about the structure of database
™™ SHOW Tables •• Sub schema - Controls on
•• Lists all the tables available in the current views of the database for the user.
­database we are working in. •• Language for data management - Basic
  Syntax: mysql>show tables; procedural for accessing the database.

Relational model:
PART IVI
™™ Oracle and DB2 are few commercial relational
models in use.
Explain in Detail
™™ Relational model is defined with two ­terminologies
Instance and Schema.
1. Discuss on various database models •• Instance – A table consisting of rows and
­available in DBMS. columns
The major database models are listed below: •• Schema – Specifies the structure including
™™ Hierarchical Database Model name and type of each column.
™™ Network model ™™ A relation (table) consists of unique attributes
™™ Relational model (columns) and tuples (rows).
™™ Object-oriented database model
SURYA 3
www.nammakalvi.org
Chapter - 3  Introduction to Database Management System XII Std - Computer Application
Object-oriented database model Entity Instance
™™ This model incorporates the combination of •• Instances are the values for the entity if we
Object Oriented Programming(OOP’s) concepts ­consider animals as the entity their instances will
and database technologies. be dog, cat, cow… Etc.
™™ Practically, this model serves as the base of •• So an Entity Instance denotes the category val-
Relational model. ues for the given entity.
™™ Object oriented model uses small, reusable
­software known as Objects. Attributes:
™™ These are stored in object oriented database. •• An attribute is the information about that entity
™™ This model efficiently manages large number of and it will describe, quantify, classify, and specify
different data types. an entity.
™™ Moreover complex behaviors are handled •• An attribute will always have a single value, that
­efficiently using OOP’s concepts. value can be a number or character or string.

2. List the basic concepts of ER Model with


Types of attributes:
suitable example.
1. Key Attribute
The basic concepts of ER model consists of
2. Simple Attributes
™™ Entity or Entity type
3. Composite Attributes
™™ Attributes
4. Single Valued Attribute
™™ Relationship
5. Multi Valued Attribute
  These are the general concepts which help to
create an ER diagram and produce an ER model.
Relationship:
There exists a relationship between two tables when
Entity or Entity type
the foreign key of one table references ­primary key
™™ An Entity can be anything a real-world object or
of other table.
animation which is easily identifiable by anyone
The Entity- Relationship(ER) diagram is based on
even by a common man.
the three types listed below.
™™ Example: In a company’s database Employee,
One-to-One relationship
HR, Manager are considered as entities.
One-to-Many relationship
™™ An entity is represented by a rectangular box.
Many-to-Many relationship

Types of Entity: 3. Discuss in detail on various types of


1. Strong Entity ­attributes in DBMS.
2. Weak Entity Types of attributes:
3. Entity Instance 1. Key Attribute:
•• Generally a key attribute describes a unique
Strong Entity ­characteristic of an entity.
•• A Strong entity is the one which doesn’t depend
on any other entity on the schema or database 2. Simple Attribute:
•• A strong entity will have a primary key with it. • • The simple attributes cannot be separated
•• It is represented by one rectangle it will be having a single value for their
entity.
Weak Entity •• For Example: Let us consider the name as the
•• A weak entity is dependent on other entities and attribute for the entity employee and here the
it doesn’t have any primary key like the Strong value for that attribute is a single value.
entity.
•• It is represented by double rectangle. 3. Composite Attributes:
•• The composite attributes can be subdivided

4 SURYA
XII Std - Computer Application Chapter - 3  Introduction to Database Management System
into simple attributes without change in the MySQL Workbench (DesktopApplication)
meaning of that attribute. ™™ It is a database tool used by developers and
•• For Example: In the above diagram the em- DBA’s mainly for visualization.
ployee is the entity with the composite attri-
bute Name which are sub-divided into two ™™ This toolhelps in data modeling, development
simple attributes first and last name. of SQL,server configuration and backup for
MySQLin a better way.
4. Single Valued Attributes: ™™ Its basic release version is 5.0and is now in 8.0
•• A single valued attribute contains only one supporting all OperatingSystems.
value for the attribute and they don’t have ™™ The SQL editor of this tool is veryflexible and
multiple numbers of values. comfortable in dealing multipleresults set.
•• For Example: Age- It is a single value for a
person as we cannot give n number of ages HeidiSQL (Desktop Application)
for a single person; therefore it is a single ™™ This open source tools helps in theadministration
valued attribute. of better database systems.
™™ It supports GUI (Graphical User Interface)
5. Multi Valued Attributes: ­features for monitoring server host, servercon-
•• A multi valued attribute has more than one nection, ­Databases, Tables, Views,Triggers and
value for that particular attribute. Events.
•• For Example: Degree - A person can hold
5. Explain in detail on Sub Queries with
n number of degrees so it is a multi-valued
­suitable examples.
attribute.
™™ The SQL query is written within amain Query.
4. Write a note on open source software tools ™™ This is called as Nested Inner/SubQuery.
available in MySQL Administration. ™™ The sub query is executed firstand the results
™™ MySQL is open source software that allows of sub query are used as thecondition for main
­managing relational databases. query.
™™ It also provides the flexibility of changing the The sub querymust follow the below rules:
source code as per the needs.  1.  Subqueries are always written withinthe
™™ It runs on multiple platforms like Windows, Linux ­parentheses.
and is scalable, reliable and fast.   2. Always place the Subquery on theright side of
the comparison operator.
PHPMYADMIN (Web Admin)   3. ORDER BY clause is not used insub query,
™™ This administrative tool of MySQL is aweb since Subqueries cannotmanipulate the results
application written in PHP. They areused
­ internally.
­predominantly in web hosting.
™™ Themain feature is providing web interface,­ Example: (Consider the Employee tablewith the
importing data from CSV and exportingdata to fields EmpID, Name, Age andSalary.)
various formats.
SELECT * from Employeewhere EmpID IN (SELECT
™™ It generates livecharts for monitoring MySQL
EmpID fromEmployee WHERE Salary < 20000);
serveractivities like connections, ­processes
andmemory usage. It also helps in making
­ First, the inner query is executed. Then outer query
­thecomplex queries easier. will be executed.

SURYA 5
www.nammakalvi.org
Chapter - 3  Introduction to Database Management System XII Std - Computer Application
10. ____describes a unique characteristic of
ADDITIONAL QUESTIONS AND ANSWERS: an entity.
a) Key Attribute
PART AI b) Simple Attributes
c) Composite Attributes
Choose the correct answers: d) Single Valued Attribute

1. Which of the following is a not a database? 11. __can be subdivided into simple attributes
a) Oracle b) PostgreSQL without change in the meaning of that
c) SQLite d) None of these ­attribute.
a) Key Attribute
2. DBMS provides to ___ data b) Simple Attributes
a) create b) retrieve c) Composite Attributes
c) update d) all of the above d) Single Valued Attribute

3. Which of the following are the limitations 12. A _____contains only one value for the
of file system ­attribute and they don’t have multiple
a) Data Duplication b) High Maintenance numbers of values.
c) Security d) All of the above a) Key Attribute
b) Simple Attributes
4. ___is defined as the system’s ability to
c) Composite Attributes
­recover all committed transactions during
d) Single Valued Attribute
the failure of storage or the system.
a) Durability b) Consistency 13. The ______cannot be separated it will be
c) Concurrency d) All of the above having a single value for their entity.
a) Key Attribute
5. Which of the following is a commercial
b) Simple Attributes
­relational models in use.
c) Composite Attributes
a) Oracle b) DB2
d) Single Valued Attribute
c) PostgreSQL d) Both a and b
14. A______has more than one value for that
6. A ____is a “copy” of a primary key
particular attribute.
a) Candidate Key b) Super Key
a) Multi valued attribute
c) Foreign Key d) Composite Key
b) Simple Attributes
7. A key with more than one attribute to c) Composite Attributes
­identify rows uniquely in a table is called d) Single Valued Attribute
____
15. ______ is most popular for Web
a) Candidate Key b) Super Key
­Administration.
c) Foreign Key d) Composite Key
a) PhpMyAdmin b) MySQL Workbench
8. An____ can be anything a real-world ­object c) HeidiSQL d) All of the above
or animation
a) Data b) Entity ANSWERS FOR OBJECTIVES
c) Instance d) Relationship 1. d 2. d 3. d 4. a 5. d
9. _____are the values for the entity 6. c 7. d 8. b 9. c 10. a
a) Data b) Entity 11. c 12. d 13. b 14. a 15. a
c) Instance d) Relationship

6 SURYA
XII Std - Computer Application Chapter - 3  Introduction to Database Management System
11. ANSI -  American National Standards
Fill in the blanks: ­Institute.
12. ISO - International Organization For
1. ____ is known a predecessor of database system ­Standardization.
Ans: File system 13. DDL - Data Definition Language.
2. MySQL is a database management system founded 14. DML - Data Manipulation Language.
by ____ Ans: Monty Widenius 15. DQL - Data Query Language.
16. TCL - Transaction Control Language.
3. ____ who takes care of configuration, installation, 17. DCL - Data Control Language.
performance, security and data backup.
Ans: Database Administrators
Syntax & Example (Basic Sql Commands)
4. _____ is a web application written in PHP
Ans: 1) CREATE DATABASE:
   Syntax: CREATE database databasename;
5. ____tool of MySQL is a web application written in
   Example: mysql> create database studentDB;
PHP. Ans: PHPMYADMIN

6. _____ is a database tool used by developers and 2) DROP DATABASE:


DBA’s mainly for visualization.    Syntax: DROP database databasename;
Ans: MySQL Workbench    Example: mysql> drop database studentDB;

7. The ____of this tool is very flexible and comfortable 3) SELECT DATABASE
in dealing multiple results set.    Syntax: USE databasename;
Ans: SQL editor    Example: mysql> USE studentDB;
8. 
____ is a program or process of copying table
­contents into a file for future reference 4) INSERT RECORD
 Ans: Backup    Syntax 1: INSERT INTO tablename (column1,
­column 2, column 3) Values(value 1, value 2,
9. SQL query is written within a main Query is called value 3)
as_____ Ans: Sub Query    Syntax 2: INSERT INTO tablename
­Values(value 1, value2, value3)
10. An attribute is the information about that _____
 Ans: Entity
5) DELETING RECORD :
   Syntax 1; DELETE for tablename WHERE
Abbrevation
Columnname =” value “
1. DBMS - Database Management System.   Syntax 2; DELETE for tablename
2. RDBMS -  Relation Database Management
System. 6) MODIFYING RECORD:
3. OSBMS - Objective Database ­Management   Syntax : UPDATE tablename SET column 1=
System. “newvalue” where column 2= value2
4. ACID - Automicity, Consistency, I­ solation,
And Durability. 7) SORTING RECORD:
5. IMS - Information Management S ­ ystem.  Syntax 1 SELECT * FROM TABLENAME ORDER
6. IDS - Integrated Data Store. BY COLUMNNAME;
7. OOP’S - Object Oriented Programming.  Syntax 2 select * from tablename ORDER BY
8. SQL - Structure Query Language. columnname DESC;
9. ER - Entity Relationship.
10. DBA - Database Administration.
SURYA 7
www.nammakalvi.org
Chapter - 3  Introduction to Database Management System XII Std - Computer Application

SQL DDL COMMANDS LIST


PART BI
Commands Description
CREATE Used to create database or Short Answers
tables
ALTER Modifies the existing structure
1. Define Database.
of database or table
™™ A database is a place where we store, retrieve
DROP Deletes a database or table
and manage data.
RENAME Used to rename an existing ™™ It is a structured set of data held in a computer
object in the database especially one that is in various ways.
TRUNCATE Used to delete all table records
2. Define DBMS
Definition:
SQL TCL COMMANDS LIST
™™ A database management system (DBMS) is
Commands Description
system software for creating and managing
COMMIT Permanent save into database databases.
ROLLBACK Restore database to orginal ™™ The DBMS provides users and programmers with
form since the last COMMIT a systematic way to create, retrieve, update and
SET SET TRANSACTION command manage data.
TRANSACTION set the transaction properties
such as read-write or read only 3. What are the various methods to access
access file system?
™™ Indexed method
SAVE POINT Use to temporarily save a trans-
™™ Random Method
action so that we can r­ ollback
™™ Sequential Method
to that point w
­ henever required
4. What are the limitations of database?
SQL DML COMMANDS LIST ™™ Data Duplication
Commands Description ™™ High Maintenance
INSERT Adds new rows into database ™™ Security
table. 5. Write the various forms of database.
UPDATE modifies existing data with new ™™ Relational Database Management System
data within a table (RDBMS)
DELETE Deletes the records from the table ™™ And Object Database Management System
(ODBMS).
SQL DQL COMMANDS LIST
6. What are the features of RDBMS?
Commands Description
The features of RDBMS are
SELECT Retrieve data from the table ™™ High Availability
™™ High Performance
SQL DCL COMMANDS LIST ™™ Robust Transactions and support
Commands Description ™™ Ease of management
Grant Used to give permission to spe- ™™ Less cost
cific users on specific database
7. What do you mean by table in Relational
objects like table, view etc
database model?
Revoke used to take out permission from
In relational database model,
specific users on specific data-
™™ Table is defined as the collection of data orga-
base objects like table, view etc.
nized in terms of rows and columns.
8 SURYA
XII Std - Computer Application Chapter - 3  Introduction to Database Management System
™™ Table is the simple representation of relations. ™™ The vertical entity in a table is known as Attribute
The true relations cannot have duplicate rows or Column.

8. Write the types of SQL commands. 2. List few commonly used databases.
™™ Data Definition Language (DDL) ™™ DB2
™™ Data Manipulation Language (DML) ™™ MySQL
™™ Data Query Language (DQL) ™™ Oracle
™™ Transaction Control Language (TCL) ™™ PostgreSQL
™™ Data Control Language (DCL) ™™ SQLite
™™ SQL Server
9. What is the purpose of JOIN Clause?
™™ Sybase
™™ When we have to select data from more than 2
tables SQL JOIN clause is used. 3. What are the roles of Database admini
™™ Retrieves data from two or more tables, by strator?
referencing columns in the tables that hold
­ ™™ Database Administrators (DBA’s) who takes
­identical values care of configuration, installation, performance,
­security and data backup.
10. What is XAMPP?
™™ DBA’s possess the skills on database design,
™™ XAMPP is a free and open source package.
­database queries, RDMS, SQL and networking.
™™ It was developed by Apache.
™™ The primary task is the creation of new user and
™™ It is a software platform for MySQL, PHP and Peri
providing them with access rights.
programming languages.
4. What are the major parts to form a
11. What is meant by the Designing of
­database?
­databases?
The three major parts that forms a database are
  The process of creating, implementing and
Tables, Queries and Views.
maintaining the enterprise data in a system is
­
™™ Tables - similar to an excel sheet, containing
known as Designing of databases.
multiple rows and columns. Where each row is a
record and each column is an attribute.
PART CI ™™ Queries – It is a question with multiple condi-
tions posted to the database. The records in the
Explain in Brief Answer database that satisfies the passed conditions are
retrieved.
1. What are attributes in database? ™™ Views – A set of stored queries.
  Write short note on Columns (attributes) in a
5. Write a note on MySQL.
­table.
™™ MySQL is a database management system
™™ The table consists of several rows and columns.
founded by Monty Widenius
™™ Table can be divided into smaller parts, in terms
™™ MySQL is open source software that allows man-
of columns.
aging relational databases.
™™ Each column is known as attributes.
™™ It also provides the flexibility of changing the
source code as per the needs.
Example:
™™ It runs on multiple platforms like Windows, Linux
•• In the Employee table four attributes are avail-
and is scalable, reliable and fast.
able namely Id, Name, Age and Salary. The
attribute is defined in a table to hold values of 6. Write a short note on Row (or Record or
same type. tuple)
•• This is known as Attribute Domain. ™™ A single entry in a table is called as Row or
•• In the Employee table, the Name field will hold Record or Tuple.
only characters not the numbers in it.
SURYA 9
www.nammakalvi.org
Chapter - 3  Introduction to Database Management System XII Std - Computer Application
™™ Set of related data’s are represented in a row or ™™ A foreign key is a “copy” of a primary keythat
tuple. has been exported from one relation into an-
™™ The horizontal entity in a table is known as other to represent the existence of a rela-
Record or row. tionship between them.
™™ A foreign key is a copy of the whole of its
7. What are the major the functions ­performed
parent primary key i.e if the primary key is
using SQL?
composite, then so is the foreign key.
  Few major functions performed using SQL are
™™ Foreign key values do not (usually) have to
listed below:
be unique.
™™ Executes queries against a database.
™™ Foreign keys can also be null.
™™ Retrieves data from database.
™™ A composite foreign key cannot have some
™™ Inserts and updates records in a database
attribute(s) null and others non-null.
™™ Delete records from database.
™™ Creates new databases and new tables in a
(iii) Candidate Key
database.
™™ Each super key is called a candidate key.
™™ A candidate key is selected from the set of
PART DI
Super Key.
™™ While selecting candidate key, redundant at-
Explain in detail
tributes should not be taken.
1. Explain the following ™™ The candidate key is also known as minimal
(i) Primary Key (ii) Foreign Key (iii) Candidate Key super keys.
(iv) Super Key (v) Composite key
(iv) Super Key
(i) Primary Key ™™ An attribute or group of attributes, which is
™™ This key of relational table identifies each re- sufficient to distinguish every tuple in the
cord in the table in a unique way. relation from every other one is known as
™™ A primary key which is a combination of Super Key.
more than one attribute is called a compos-
ite primary key. (v) Composite Key (Compound Key)
™™ The candidate key that is chosen to perform ™™ A key with more than one attribute to identify
the identification task is called the primary rows uniquely in a table is called Composite
key key.
™™ This is also known as Compound Key.
(ii) Foreign Key

2. Tabulate the ER diagram notations

ER Component Description (how it is represented) Notation


Entity - Strong Simple rectangular box
Student

Entity - Weak Double rectangular boxes

Relationships Rhombus symbol - Strong

10 SURYA
XII Std - Computer Application Chapter - 3  Introduction to Database Management System

Between Entities Rhombus within rhombus – Weak

Attributes Ellipse symbol connected to the entity


Age

Student

Key Attribute for Underline the attribute name inside


Entity Ellipse Key Attribute

Derived Attribute Dotted ellipse inside main ellipse


for Entity

Multivalued Double Ellipse


­Attribute for Entity

www.nammakalvi.org

SURYA 11

You might also like