Name : Debanki Mitra
SEMESTER : 4TH
section : 4a
course : BBA
Paper Name : DATABASE MANAGEMENT
WITH SQL
Paper Code : MIC401B
• DDL (Data Definition
Language) is used to define and
modify database structures.
Data Examples: CREATE, ALTER, DROP.
Definition &
Manipulation • DML (Data Manipulation
Language Language) is used to manipulate
data within tables.
Examples: INSERT, UPDATE,
DELETE, SELECT.
Three Levels of
Database
Architecture
• Internal Level:
Physical storage of
data.
• Conceptual Level:
Logical structure of
the entire database.
• External Level: User
views and access
rights.
Normalization (1NF to 3NF)
• 2NF: Removes partial
• 1NF: Eliminates dependencies (every
duplicate columns and non-key column must
ensures atomicity. depend on the whole
primary key).
• 3NF: Eliminates
transitive dependencies
(non-key columns
should not depend on
other non-key columns).
NOTE : Normalization reduces redundancy and anomalies.
SQL Queries
Consider the following table STUDENTS
:
• Selecting all students from Mumbai
• To select all the students who live in Mumbai, you need
to filter the City column to only include rows where the
value is 'Mumbai'. This is done using the WHERE clause in
SQL.
• SQL Query:
SELECT * FROM STUDENTS WHERE City = 'Mumbai';
• Explanation:
• SELECT *: This selects all columns from the STUDENTS
table.
• FROM STUDENTS: This specifies that we are querying the
STUDENTS table.
• WHERE City = 'Mumbai': This filters the rows to only
include students whose City column value is 'Mumbai'.
• The result of this query will be:
ii) Displaying only student names and courses
In this case, you are only interested in the Name and
Course columns from the STUDENTS table. To do this,
you need to specify just those two columns in the SELECT
statement.
SQL Query:
SELECT Name, Course FROM STUDENTS;
Explanation:
•SELECT Name, Course: This specifies that you only want to
retrieve the Name and Course columns from the table.
•FROM STUDENTS: This specifies the STUDENTS table as the
source.
The result of this query will be: