Experiment No.
1 - DDL Commands (Create, Alter, Drop)
Objective:
To understand how to define, modify, and delete database structures using DDL commands.
Theory:
DDL includes SQL commands like CREATE, ALTER, DROP to define and manage table structures.
-- Create table
CREATE TABLE Student (
sno NUMBER(3),
sname CHAR(10),
class CHAR(5)
);
-- Alter table
ALTER TABLE Student ADD address VARCHAR(20);
-- Drop table
DROP TABLE Student;
Output:
SNO SNAME CLASS
1 Ravi BCA
2 Amit BCA
Experiment No. 2 - DML Commands (Insert, Update, Delete)
Objective:
To learn how to manipulate data in the database using DML commands.
Theory:
DML includes INSERT, UPDATE, DELETE for managing records in a table.
-- Insert data
INSERT INTO Student (sno, sname, class, address)
VALUES (1, 'Ravi', 'BCA', 'Delhi');
-- Update data
UPDATE Student SET sname = 'Amit' WHERE sno = 1;
-- Delete data
DELETE FROM Student WHERE sno = 1;
Output:
SNO SNAME CLASS ADDRESS
2 Amit BCA Delhi
3 Sita BCA Noida