CLASS XII
Chapter 10
RELATIONAL DATABASES
1. Summarize the major differences between a relation and a traditional file.
Basis Relation (Table in DBMS) Traditional File
Structure Data stored in tabular form (rows & columns). Data stored sequentially or in flat files.
Data Provides data independence (structure can be No data independence; structure changes
Independence modified easily). affect programs.
Data Redundancy Reduced due to normalization. High redundancy (same data repeated).
Accessed sequentially or through file-handling
Access Accessed using SQL queries.
code.
Relationships Relationships between tables via keys. No direct relationship between files.
2. Define the terms: (i) Database (ii) SQL (iii) View.
Database: An organized collection of related data that can be easily accessed, managed, and updated.
SQL (Structured Query Language): A standardized language used to store, manipulate, and retrieve data in a
relational database.
View: A virtual table created by a SQL query that displays data from one or more tables without storing it
physically.
3. What is data redundancy? How does it impact a database?
Definition: Data redundancy occurs when the same piece of data is stored in multiple places within a
database.
Impact:
o Increases storage space unnecessarily.
o Causes data inconsistency when updates are not made everywhere.
o Leads to higher maintenance cost.
4. What is data inconsistency? How does it impact a database?
Definition: Data inconsistency occurs when different copies of the same data have different values.
Impact:
o Leads to unreliable or incorrect information.
o Makes decision-making difficult.
o Reduces data integrity in the database.
5. Define the term Domain with respect to RDBMS. Give one example to support your answer.
Definition: Domain refers to the set of permissible values that an attribute can take in a relation.
Example: In a table Student, the attribute Age may have a domain of integers between 5 and 25.
6. Define the terms: (i) Tuple (ii) Attribute (iii) Domain (iv) Degree (v) Cardinality
Tuple: A single row in a table representing one record.
Attribute: A column in a table representing a data field.
Domain: The range of valid values for an attribute.
Degree: The total number of attributes (columns) in a relation.
Cardinality: The total number of tuples (rows) in a relation.
7. Define the terms: (i) Primary Key (ii) Foreign Key
Primary Key: A field or combination of fields that uniquely identifies each record in a table. Example: RollNo
in Student table.
Foreign Key: A field in one table that refers to the primary key of another table. Example: DeptID in Employee
table referring to DeptID in Department table.
8. What is MySQL? What are its functions and features?
Definition: MySQL is an open-source relational database management system (RDBMS) that uses SQL for
managing databases.
Functions:
o Data storage, retrieval, and manipulation.
o User access management.
o Data integrity and security.
Key Features:
o Open-source and platform-independent.
o Supports large databases.
o High performance and scalability.
o Easy connectivity with Python and PHP.
o Supports client-server architecture.
9. What is the role of database server in a DBMS?
A database server is the central system responsible for:
o Storing and managing data.
o Processing SQL queries from clients.
o Ensuring data consistency and security.
o Handling concurrent user access.
o Providing backup and recovery.
10. What is the use of SQL in MySQL? Give the key features of MySQL.
Use of SQL in MySQL:
SQL is used in MySQL to create, modify, and manage databases, tables, and data. It allows users to define
structure (DDL), manipulate data (DML), and control access (DCL).
Key Features of MySQL:
o Uses SQL for all database operations.
o Supports multi-user environment.
o Fast, reliable, and secure.
o Open source and portable.
o Integrates with many programming languages.
11. How are SQL commands classified?
SQL commands are grouped into the following categories:
1. DDL (Data Definition Language) – defines structure of database objects. (CREATE, ALTER, DROP)
2. DML (Data Manipulation Language) – manages data within tables. (INSERT, UPDATE, DELETE)
3. DCL (Data Control Language) – controls user access. (GRANT, REVOKE)
4. TCL (Transaction Control Language) – manages transactions. (COMMIT, ROLLBACK, SAVEPOINT)
5. DQL (Data Query Language) – retrieves data. (SELECT)
12. What functions should be performed by ideal DDL?
An ideal DDL should:
Allow creation of database objects (tables, views, indexes).
Enable modification of structures (ALTER).
Support deletion of objects (DROP).
Define constraints like primary key, foreign key, etc.
Maintain schema consistency and data integrity.
13. Differentiate between DDL and DML commands.
Basis DDL (Data Definition Language) DML (Data Manipulation Language)
Purpose Defines database structure. Manages data inside tables.
Examples CREATE, ALTER, DROP INSERT, UPDATE, DELETE
Effect Affects entire table structure. Affects only table data.
Auto Commit Automatically commits changes. Does not auto-commit.
Usage Used by DBA. Used by end users and programmers.
14. Name some commands used to assign/revoke privileges from database users.
GRANT – provides access privileges to users.
REVOKE – removes or withdraws access privileges from users.
Example:
GRANT SELECT, INSERT ON Student TO 'Amit';
REVOKE INSERT ON Student FROM 'Amit';
15. Name some table maintenance commands.
Common table maintenance commands are:
TRUNCATE TABLE – deletes all rows but keeps structure.
ALTER TABLE – modifies structure (add/modify/drop column).
DROP TABLE – deletes table structure and data permanently.
RENAME TABLE – renames a table.
16. What is TCL part of SQL?
TCL (Transaction Control Language) manages transactions within a database.
Functions: Ensures data consistency and integrity.
Commands:
o COMMIT – saves all changes permanently.
o ROLLBACK – undoes changes before commit.
o SAVEPOINT – creates a temporary point to which rollback can occur.