Certainly, here's how you would create the tables and set up the relationships using SQL commands: ```sql -- Creating the dept table CREATE TABLE dept ( deptID INT PRIMARY KEY, deptName VARCHAR(255), establishmentYear INT ); -- Creating the student table CREATE TABLE student ( studentID INT PRIMARY KEY, Name VARCHAR(255), cgpa DECIMAL(3, 2), hometown VARCHAR(255), mobile VARCHAR(20), dept INT, FOREIGN KEY (dept) REFERENCES dept(deptID) ); -- Creating the employee table CREATE TABLE employee ( employeeID INT PRIMARY KEY, eName VARCHAR(255), salary DECIMAL(10, 2), hometown VARCHAR(255), dept INT, FOREIGN KEY (dept) REFERENCES dept(deptID) ); ``` Once the tables are created, you can add valid data using `INSERT INTO` statements: ```sql -- Adding valid data to the dept table INSERT INTO dept (deptID, deptName, establishmentYear) VALUES (1, 'Computer Science', 2000), (2, 'Electrical Engineering', 1995); -- Adding valid data to the student table INSERT INTO student (studentID, Name, cgpa, hometown, mobile, dept) VALUES (101, 'John Doe', 3.75, 'New York', '123-456-7890', 1), (102, 'Jane Smith', 3.90, 'Los Angeles', '987-654-3210', 1); -- Adding valid data to the employee table INSERT INTO employee (employeeID, eName, salary, hometown, dept) VALUES (201, 'Michael Johnson', 60000, 'Chicago', 1), (202, 'Emily Brown', 75000, 'San Francisco', 2); ``` As for testing with invalid data, you can try inserting data that violates constraints, such as using a non-existent department ID as a foreign key in the `student` and `employee` tables, or inserting duplicate primary key values. SQL systems will generally throw errors for such cases, showing that incorrect data is being discarded. Keep in mind that the actual SQL syntax might slightly vary depending on the database management system you're using.