Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Q 1 . Create a table named Employee with the following structure: EmployeeID ( integer , primary key ) FirstName ( varchar , not null
Q Create a table named Employee with the following structure:
EmployeeID integer primary key
FirstName varchar not null
LastName varchar not null
Department varchar not null
Salary decimal not null
Insert three rows of data into the Employee table:
EmployeeID: FirstName: 'John', LastName: 'Doe', Department: IT Salary:
EmployeeID: FirstName: 'Jane', LastName: 'Smith', Department: HR Salary:
EmployeeID: FirstName: 'Bob', LastName: 'Johnson', Department: 'Finance', Salary:
Q Create a table named Orders with the following structure:
OrderID integer primary key
CustomerID integer not null
OrderDate date not null
TotalAmount decimal not null
Insert two rows of data into the Orders table:
OrderID: CustomerID: OrderDate: TotalAmount:
OrderID: CustomerID: OrderDate: TotalAmount:
Q Write an SQL query to retrieve the first and last names of employees in the IT department with a salary greater than
Q Write an SQL query to find the total number of orders and the average total amount per order.
Q Write an SQL query to retrieve a list of unique departments from the Employee table in alphabetical order.
Q Case Study:University Enrollment System
The ABC University is planning to develop an Enrollment System to efficiently manage student enrollments, courses, and faculty assignments. The university currently offers various undergraduate and postgraduate programs across different departments. The system aims to streamline the enrollment process, facilitate course management, and ensure proper assignment of faculty members to courses.
Background:
The university has multiple departments such as Computer Science, Mathematics, Physics, and Business Administration. Each department offers a set of courses that students can enroll in based on their program of study. Students can pursue different programs like Bachelor of Science in Computer Science, Master of Business Administration, etc.
Entities:
Student:
Students enroll in programs offered by departments.
Each student has a unique student ID name, and contact details.
Students can be part of multiple programs during their academic journey.
Program:
Programs are offered by specific departments.
Each program has a program code, title, and duration.
Department:
Departments oversee the programs and courses offered.
Each department has a department code, name, and location.
Course:
Courses are specific subjects offered by departments.
Each course has a course code, title, and credit hours.
Faculty:
Faculty members are assigned to teach courses within departments.
Each faculty member has a faculty ID name, and specialization.
Relationships:
Enrollment:
Students enroll in programs offered by departments.
Programs have multiple enrolled students.
Departmental Oversight:
Each department oversees multiple programs.
Programs belong to specific departments.
Course Offering:
Departments offer various courses.
Courses are offered by specific departments.
Faculty Assignment:
Faculty members are assigned to teach courses.
Courses have assigned faculty members.
Scenario:
A student, John, enrolls in the Bachelor of Science in Computer Science program offered by the Computer Science Department. Within this program, he enrolls in specific courses like "Database Management" and "Software Engineering." The Computer Science Department oversees the program, and faculty members are assigned to teach the courses.
The Enrollment System needs to capture these relationships and entities to ensure seamless management of student enrollments, programs, courses, departments, and faculty assignments.
Evaluation Marks:
Entity Identification Mark:
Awarded for correctly identifying and defining entities such as Student, Program, Department, Course, and Faculty.
Relationship Identification Marks:
Awarded for recognizing and defining relationships such as Enrollment, Departmental Oversight, Course Offering, and Faculty Assignment.
Completeness and Coherence Marks:
Awarded for ensuring that the identified entities and relationships align with the university's scenario and goals, demonstrating a comprehensive understanding of the system's requirements.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started