0% found this document useful (0 votes)
4 views

Section A Database Design

The document outlines the design and structure of a university database, including an Entity-Relationship Diagram and a SQL dump for the 'students_tbl' table. It details the creation of the table, insertion of sample data, and the establishment of primary keys and foreign key constraints. Additionally, it mentions sections on SQL queries and stored procedures/triggers without providing specific examples.

Uploaded by

kier.gales
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

Section A Database Design

The document outlines the design and structure of a university database, including an Entity-Relationship Diagram and a SQL dump for the 'students_tbl' table. It details the creation of the table, insertion of sample data, and the establishment of primary keys and foreign key constraints. Additionally, it mentions sections on SQL queries and stored procedures/triggers without providing specific examples.

Uploaded by

kier.gales
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 9

Section A: Database Design

· Entity-Relationship (ER) Diagram

· Database Schema

-- phpMyAdmin SQL Dump

-- version 5.2.1

-- https://www.phpmyadmin.net/

--

-- Host: 127.0.0.1

-- Generation Time: Mar 24, 2025 at 12:42 PM

-- Server version: 10.4.32-MariaDB

-- PHP Version: 8.0.30

SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";


START TRANSACTION;

SET time_zone = "+00:00";

/*!40101 SET
@OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT
*/;

/*!40101 SET
@OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULT
S */;

/*!40101 SET
@OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTIO
N */;

/*!40101 SET NAMES utf8mb4 */;

--

-- Database: `university_db`

--

-- --------------------------------------------------------

--

-- Table structure for table `students_tbl`

--

CREATE TABLE `students_tbl` (


`studentID` int(11) NOT NULL,

`name` varchar(100) NOT NULL,

`email` varchar(100) NOT NULL,

`dept_ID` int(11) NOT NULL

) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4


COLLATE=utf8mb4_general_ci;

--

-- Dumping data for table `students_tbl`

--

INSERT INTO `students_tbl` (`studentID`, `name`, `email`,


`dept_ID`) VALUES

(1, 'Gales, Keir Steven A.', '[email protected]', 1),

(2, 'Uraga, Nhatsumi CLeir', '[email protected]', 2);

--

-- Indexes for dumped tables

--

--

-- Indexes for table `students_tbl`

--

ALTER TABLE `students_tbl`

ADD PRIMARY KEY (`studentID`),


ADD KEY `students_tbl_ibfk_1` (`dept_ID`);

--

-- AUTO_INCREMENT for dumped tables

--

--

-- AUTO_INCREMENT for table `students_tbl`

--

ALTER TABLE `students_tbl`

MODIFY `studentID` int(11) NOT NULL AUTO_INCREMENT,


AUTO_INCREMENT=3;

--

-- Constraints for dumped tables

--

--

-- Constraints for table `students_tbl`

--

ALTER TABLE `students_tbl`

ADD CONSTRAINT `students_tbl_ibfk_1` FOREIGN KEY


(`dept_ID`) REFERENCES `department` (`dept_ID`) ON DELETE
CASCADE ON UPDATE CASCADE;

COMMIT;
/*!40101 SET
CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;

/*!40101 SET
CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;

/*!40101 SET
COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;

Section B: SQL Queries


· Basic Queries

· Intermediate Queries
· Advanced Queries

Section C: Stored Procedures and Triggers


· Stored Procedure
o Execution Store Procedure
· Trigger

· Test Trigger

You might also like