University of South Asia
Assignment Solution — Database Systems
Assignment # 02 Session Spring 2026
Subject Database Systems Total Marks 10
Deadline 19th March 2026 Department Computer Science
Instructor Zobia Zafar Program BSCS-III
Section A Topic Basic Database Concepts
Part 1: Basic Concepts
Q1. Define Database.
Ans: A database is an organized and structured collection of related data that is stored electronically and can
be accessed, managed, and updated efficiently. It allows multiple users and applications to store and retrieve
data in a systematic way, eliminating disorganization and redundancy.
Example: A school database that stores student names, roll numbers, grades, and attendance records.
Q2. Define Database Management System (DBMS).
Ans: A Database Management System (DBMS) is software that acts as an interface between the user and
the database. It provides tools and functions to create, retrieve, update, and delete data while ensuring data
security, integrity, and consistency.
Example: MySQL, Oracle, Microsoft SQL Server, and PostgreSQL are well-known DBMS software
applications.
Q3. What is Data?
Ans: Data refers to raw, unprocessed facts and figures that on their own carry no particular meaning. It can
be in the form of numbers, text, images, or symbols. Data becomes useful only when it is processed and
organized into a meaningful format.
Example: The number 95, the name 'Ali', or the date '2026-03-19' are individual pieces of data.
Q4. What is Information?
Ans: Information is data that has been processed, organized, and interpreted to give it meaning and context.
Unlike raw data, information is useful for decision-making because it answers specific questions and carries
significance.
Example: 'Ali scored 95 marks in Database Systems on 19th March 2026' is information derived from raw
data.
Q5. Define Table in a Database.
Ans: A table in a database is a structured arrangement of data organized into rows and columns. Each
column represents a specific attribute (field), and each row represents a single record. Tables are the
fundamental building blocks of relational databases.
Example: A 'Students' table with columns: StudentID, Name, Age, CGPA — each row holds one student's
details.
Part 2: Database Structure
Q6. Define Field.
Ans: A field is the smallest unit of data storage in a database table, representing a single attribute or
characteristic of an entity. Each field has a specific data type (e.g., integer, text, date) and stores one piece of
information per record.
Example: In a 'Students' table, 'StudentID', 'Name', and 'CGPA' are individual fields.
Q7. Define Record.
Ans: A record is a complete set of related fields that together describe a single instance of an entity in a
database table. It corresponds to a single row in a table and contains all the data for one particular entity.
Example: One row in the Students table — (101, 'Ali Khan', 20, 3.8) — is a complete record.
Q8. What is an Attribute?
Ans: An attribute is a property or characteristic that describes an entity in a database. In relational databases,
attributes correspond to the columns of a table. Each attribute holds a specific type of data and represents
one feature of the entity.
Example: For an 'Employee' entity, attributes could be EmployeeID, Name, Department, and Salary.
Q9. What is an Entity?
Ans: An entity is any real-world object, person, concept, or event about which data can be stored in a
database. Entities are represented as tables in a relational database, and each instance of an entity becomes
a record (row) in the table.
Example: A 'Student', 'Course', 'Teacher', or 'Product' can each be an entity in a database.
Q10. Define Tuple.
Ans: A tuple is a single row in a database relation (table). It represents one complete instance of an entity
and contains a value for each attribute (column) defined in the table. The term 'tuple' comes from relational
database theory and is synonymous with 'record' or 'row'.
Example: (102, 'Sara Malik', 21, 3.5) is a tuple in a Students relation with four attributes.
Part 3: Keys in Database
Q11. Define Primary Key.
Ans: A primary key is a field (or combination of fields) in a database table that uniquely identifies each record.
It must contain unique values and cannot be NULL. Every table should have one primary key to ensure each
row can be distinctly located.
Example: In a Students table, 'StudentID' (e.g., 101, 102, 103) is the primary key — no two students share
the same ID.
Q12. Define Foreign Key.
Ans: A foreign key is a field in one table that refers to the primary key of another table. It establishes a link
(relationship) between two tables and is used to maintain referential integrity, ensuring that data in the
referencing table corresponds to valid data in the referenced table.
Example: In an 'Enrollments' table, 'StudentID' is a foreign key that refers to the primary key in the 'Students'
table.
Q13. Define Candidate Key.
Ans: A candidate key is any field or set of fields in a table that can qualify as a primary key — meaning it has
unique values for every record and contains no NULL values. A table can have multiple candidate keys, but
only one is chosen as the primary key.
Example: In a Students table, both 'StudentID' and 'Email' could be candidate keys since both uniquely
identify a student.
Q14. Define Composite Key.
Ans: A composite key is a primary key made up of two or more columns (fields) that together uniquely identify
a record in a table. No single column alone is sufficient to guarantee uniqueness; the combination of all the
selected columns creates the unique identifier.
Example: In an 'Enrollments' table, the combination of (StudentID + CourseID) forms a composite key, since
a student can enroll in many courses.
Part 4: SQL Basics
Q15. What is SQL (Structured Query Language)?
Ans: SQL (Structured Query Language) is a standardized programming language used to communicate with
and manage relational databases. It allows users to create database structures, insert and update data,
retrieve specific information, and control access permissions.
Example: Commands like SELECT, INSERT, UPDATE, DELETE, and CREATE are all part of SQL.
Q16. Define CREATE Command.
Ans: The CREATE command in SQL is used to create a new database object such as a table, database,
index, or view. When creating a table, the user defines its name, columns, data types, and constraints. It
belongs to the Data Definition Language (DDL) category of SQL.
Example: CREATE TABLE Students (StudentID INT PRIMARY KEY, Name VARCHAR(50), Age INT);
Q17. Define INSERT Command.
Ans: The INSERT command is a Data Manipulation Language (DML) statement used to add new rows
(records) into an existing database table. The user specifies the table name and the values to be inserted for
each column, either for all columns or for selected ones.
Example: INSERT INTO Students (StudentID, Name, Age) VALUES (101, 'Ali Khan', 20);
Q18. Define UPDATE Command.
Ans: The UPDATE command is a DML statement used to modify existing data in one or more records of a
table. A WHERE clause is typically used to specify which records should be updated; without it, all records in
the table would be changed.
Example: UPDATE Students SET Age = 21 WHERE StudentID = 101;
Q19. Define DELETE Command.
Ans: The DELETE command is a DML statement used to remove one or more existing records from a table.
A WHERE clause narrows down which specific records to delete. Without a WHERE clause, all records from
the table are deleted, though the table structure remains intact.
Example: DELETE FROM Students WHERE StudentID = 101;
Q20. Define SELECT Command.
Ans: The SELECT command is used to retrieve or query data from one or more tables in a database. It is the
most frequently used SQL command and belongs to the Data Query Language (DQL) category. Results can
be filtered using WHERE, sorted using ORDER BY, and grouped using GROUP BY.
Example: SELECT Name, Age FROM Students WHERE Age > 18 ORDER BY Name;
Part 5: Additional Concepts
Q21. What is Data Redundancy?
Ans: Data redundancy occurs when the same piece of data is stored in multiple places within a database. It
wastes storage space, makes updates difficult (the same data must be changed in many places), and can
lead to inconsistencies if one copy is updated and others are not.
Example: Storing a student's address in both the 'Students' table and the 'Hostel' table separately is data
redundancy.
Q22. What is Data Integrity?
Ans: Data integrity refers to the accuracy, consistency, and reliability of data stored in a database over its
entire lifecycle. It ensures that data is correct and has not been corrupted or altered in unauthorized ways,
maintained through rules, constraints, and validation checks.
Example: A NOT NULL constraint on a StudentID field ensures that every record always has a valid student
ID, maintaining data integrity.
Q23. What is Normalization?
Ans: Normalization is the process of organizing a relational database to reduce data redundancy and improve
data integrity. It involves dividing large tables into smaller, related tables and defining relationships between
them. It follows a series of rules called normal forms (1NF, 2NF, 3NF, etc.).
Example: Splitting one large table containing student and course data into separate 'Students' and 'Courses'
tables linked by a foreign key is normalization.
Q24. Define Relational Database.
Ans: A relational database is a type of database that stores and organizes data in the form of related tables
(relations). Data in different tables can be linked using keys, allowing complex queries across multiple tables.
It is based on the relational model proposed by E.F. Codd.
Example: MySQL and PostgreSQL are relational databases where tables like 'Students', 'Courses', and
'Enrollments' are linked through keys.
Q25. What is a Constraint in DBMS?
Ans: A constraint in DBMS is a rule or restriction applied to a column or table to enforce data integrity and
ensure the accuracy of data. Constraints prevent invalid data from being entered into the database and define
the boundaries within which data must fall.
Example: PRIMARY KEY, NOT NULL, UNIQUE, FOREIGN KEY, and CHECK are common constraints. For
instance, CHECK (Age >= 18) ensures no student younger than 18 is entered.
— End of Assignment Solution —