SQL DDL and DML Commands Assignment_ Complete Impl
SQL DDL and DML Commands Assignment_ Complete Impl
Reg No.:-21bce1499
This comprehensive assignment provides hands-on experience with SQL Data Definition
Language (DDL) and Data Manipulation Language (DML) commands using MySQL .
[1][2]
The assignment covers database creation, table design, data manipulation, and
advanced querying techniques essential for database management .
The installation process involves configuring the MySQL Server with "Development
Computer" settings, setting a secure password for the root account, and ensuring the
server runs on the default port 3306 . After installation, students should launch
[8][12]
MySQL Workbench and create a connection to the local MySQL server using standard
TCP/IP protocol .
The assignment utilizes a university database system with five interconnected tables:
Students, Departments, Professors, Courses, and Enrollments . This design
[14][15]
The Students table serves as the primary entity storing student information with
constraints ensuring data quality through CHECK constraints on GPA values and UNIQUE
constraints on email addresses . The Departments table maintains institutional
[18][19]
structure, while the Professors table links faculty to their respective departments through
foreign key relationships .
The DDL implementation begins with creating the university database and selecting it for
use . The CREATE TABLE statements demonstrate various constraint types including
[1][22]
PRIMARY KEY, FOREIGN KEY, UNIQUE, NOT NULL, CHECK, and DEFAULT constraints .
[18][23]
The table creation sequence follows dependency order: Departments and Students tables
first (no foreign key dependencies), followed by Professors (references Departments),
then Courses (references both Departments and Professors), and finally Enrollments
(references both Students and Courses) .
[15][16]
. These operations show how database schemas can evolve over time while
[25]
The DML implementation starts with INSERT statements that populate all five tables with
sample data [26][2]
. The insertion order respects foreign key constraints, ensuring parent
table records exist before inserting child table records .
UPDATE commands show how to modify existing data while respecting integrity
constraints . DELETE operations demonstrate selective data removal with proper
[26][7]
The assignment includes a detailed execution workflow that guides students through
each phase of implementation [35][37]
. The process is divided into five phases: setup and
installation, DDL commands implementation, DML commands implementation, advanced
queries, and documentation [6][37]
.
Each step includes specific time estimates, expected outputs, and screenshot
requirements to ensure comprehensive documentation . The guide provides
[35][12]
statements generate "X row(s) affected" messages where X represents the number of
inserted records .
[26][2]
SELECT queries return result sets displaying requested data in tabular format, with
column headers and properly formatted values . UPDATE and DELETE operations
[28][30]
provide feedback on the number of affected rows, ensuring students can verify their
modifications .
[26][7]
DDL vs DML Commands Distribution in SQL Assignment
DML operations encompass 5 INSERT statements populating all tables, 7 different SELECT
query variations, 3 UPDATE commands, and 1 DELETE operation . Advanced features
[26][7]
include multiple JOIN types, subqueries, and aggregate functions with GROUP BY clauses
Result:
Successfully executed all DDL and DML commands on a sample database table.
Conclusion:
This experiment demonstrated the use of SQL DDL commands to define the structure of
a database and DML commands to manage the data stored in the database.