Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
6 views7 pages

DWM Exp04

The document outlines the creation of a database named RGIT, including the establishment of several tables: Time, Professor, Student, Course, and AnalysisMeasure. Each table is defined with specific fields and data types, followed by the insertion of sample data into these tables. Additionally, the document includes SQL commands for selecting data from the created tables.

Uploaded by

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

DWM Exp04

The document outlines the creation of a database named RGIT, including the establishment of several tables: Time, Professor, Student, Course, and AnalysisMeasure. Each table is defined with specific fields and data types, followed by the insertion of sample data into these tables. Additionally, the document includes SQL commands for selecting data from the created tables.

Uploaded by

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

EXPERIMENT 04

CREATE DATABASE RGIT;


USE RGIT;

Time Dimension :
CREATE TABLE Time (Time_ID INT AUTO_INCREMENT PRIMARY KEY, Day DATE, Week INT, Month
INT, Semester VARCHAR(10), Year INT);
DESC Time;

INSERT INTO Time (Day, Week, Month, Semester, Year)


VALUES ('2024-01-15', 3, 1, 'Spring', 2024), ('2024-05-10', 19, 5, 'Spring', 2024),
('2024-08-20', 34, 8, 'Fall', 2024), ('2024-12-01', 48, 12, 'Fall', 2024), ('2025-03-15', 11, 3, 'Spring', 2025);
select * from Time;

Professor Dimension :
CREATE TABLE Professor (Professor_ID INT PRIMARY KEY, Professor_Name VARCHAR(100), Department
VARCHAR(100), Email VARCHAR(100), Phone_Number VARCHAR(15));

desc Professor;
INSERT INTO Professor (Professor_ID, Professor_Name, Department, Email, Phone_Number)
VALUES (1, 'Dr. John Doe', 'Computer Science', '[email protected]', '123-456-7890'),
(2, 'Dr. Alice Brown', 'Mathematics', '[email protected]', '123-456-7891'),
(3, 'Dr. Mark Johnson', 'Physics', '[email protected]', '123-456-7892'),
(4, 'Dr. Emily Davis', 'Chemistry', '[email protected]', '123-456-7893'),
(5, 'Dr. William Smith', 'Biology', '[email protected]', '123-456-7894');

Student Dimension :
CREATE TABLE Student (Student_ID INT PRIMARY KEY, Student_Name VARCHAR(100), DOB DATE,
Gender VARCHAR(10), Grade VARCHAR(2), Attendance INT, Marks INT, GPA FLOAT, Assignment_Count
INT);
DESC Student;
INSERT INTO Student (Student_ID, Student_Name, DOB, Gender, Grade, Attendance, Marks, GPA,
Assignment_Count) VALUES (1, 'Jane Smith', '2000-01-15', 'Female', 'A', 95, 450, 3.8, 10),
(2, 'Tom Hardy', '1999-05-22', 'Male', 'B', 90, 400, 3.5, 9),
(3, 'Sarah Connor', '2001-08-14', 'Female', 'A', 97, 470, 3.9, 11),
(4, 'James Bond', '1998-11-12', 'Male', 'C', 85, 350, 2.8, 8),
(5, 'Natasha Romanoff', '2000-03-23', 'Female', 'A', 98, 480, 4.0, 12);
SELECT * FROM Student;
Course Dimension :

CREATE TABLE Course (Course_ID INT PRIMARY KEY, Name VARCHAR(100), Type VARCHAR(50),
Duration VARCHAR(50), University VARCHAR(100));
DESC Course;

INSERT INTO Course (Course_ID, Name, Type, Duration, University)


VALUES (1, 'Data Structures', 'Core', '4 months', 'RGIT'), (2, 'Calculus I', 'Core', '4 months', 'RGIT'),
(3, 'Classical Mechanics', 'Elective', '4 months', 'RGIT'), (4, 'Organic Chemistry', 'Core', '4 months', 'RGIT'), (5,
'Molecular Biology', 'Core', '4 months', 'RGIT');
SELECT * FROM Course;
FACT TABLE :
CREATE TABLE AnalysisMeasure (
Fact_ID INT AUTO_INCREMENT PRIMARY KEY, Student_ID INT, Professor_ID INT, Course_ID INT,
Time_ID INT, Attendance INT, Marks INT, GPA FLOAT, Participation_Count INT, Assignment_Count INT,
FOREIGN KEY (Student_ID) REFERENCES Student(Student_ID), FOREIGN KEY (Professor_ID)
REFERENCES Professor(Professor_ID), FOREIGN KEY (Course_ID) REFERENCES Course(Course_ID),
FOREIGN KEY (Time_ID) REFERENCES Time(Time_ID));

DESC AnalysisMeasure;
INSERT INTO AnalysisMeasure (Student_ID, Professor_ID, Course_ID, Time_ID, Attendance, Marks, GPA,
Participation_Count, Assignment_Count)
VALUES (1, 1, 1, 1, 95, 450, 3.8, 15, 10), (2, 2, 2, 2, 90, 400, 3.5, 20, 9), (3, 3, 3, 3, 97, 470, 3.9, 18, 11), (4, 4, 4,
4, 85, 350, 2.8, 17, 8), (5, 5, 5, 5, 98, 480, 4.0, 19, 12);

SELECT * FROM AnalysisMeasure;

You might also like