Nội dung text DBMS Practical And Journal
Database and Table Management Practicals Navedul Hasan Khan FY BSc IT - 10 Practical 1: Creating and Managing a Database Aim: To create, view, use, and drop a database in MySQL. Queries & Expected Output: Step 1: View all existing databases SHOW DATABASES; Output: Step 2: Create a new database CREATE DATABASE CompanyDB; Output: Step 3: Create another database without constraints CREATE DATABASE TempDB; Output:
Step 4: Use a database USE CompanyDB; Output: Step 5: Drop a database DROP DATABASE TempDB; Output:
Practical 2: Creating Tables (With and Without Constraints) Aim: To create tables with and without constraints in MySQL. Queries: Table with constraints CREATE TABLE Employees ( EmpID INT PRIMARY KEY, EmpName VARCHAR(50) NOT NULL, Department VARCHAR(50) DEFAULT 'General', Salary DECIMAL(10,2) CHECK (Salary > 0) ); Output: Table without constraints CREATE TABLE Departments ( DeptID INT, DeptName VARCHAR(50), Location VARCHAR(50) );