Data integrity and security using DDL and DML

December 4, 2026 · Team EasyExamNotes · 1 min read (est.) · 0 comments

Share on WhatsApp

← RGPV CS-502 DBMS June 2025 solved question paper

RGPV CS-502 (GS) | June 2025 | Q5(a)

Question (restated): Explain how DDL and DML can preserve integrity and security.

Answer

DDL defines constraints and schema; DML inserts, updates and deletes data under those constraints. Primary keys enforce entity integrity, foreign keys enforce referential integrity, and CHECK and NOT NULL restrict domains.

CREATE TABLE Student (Sid INT PRIMARY KEY, Name VARCHAR(80) NOT NULL, Marks INT CHECK (Marks BETWEEN 0 AND 100));
UPDATE Student SET Marks=75 WHERE Sid=101;

Use transactions for multi-step changes and rollback on errors. Parameterized queries prevent SQL injection when user input is supplied. Grant only required privileges through DCL, for example GRANT SELECT ON Student TO reader; restrict schema changes to administrators. Views can expose selected columns; auditing records sensitive operations. Constraints are not substitutes for authorization, and application validation complements database checks.

← RGPV CS-502 DBMS June 2025 solved question paper

Discussion

Ask a question, share your thoughts or report an error.

Sign in to participate in the discussion.

Join the discussion