SQL Assignment 2
SQL Assignment 2
Objective:
Create a database, create tables within the database, insert data, and perform SELECT
queries.
1. Create a new database called SchoolDB. The database should be the central place for
all your tables and data.
2. Select the database you just created to work in it.
1. Design tables based on your requirements. For a simple school database, you can
create the following tables:
o Students Table: Store details like student name, age, gender, and grade.
o Courses Table: Store course details like course name, course code, and
instructor.
o Enrollments Table: Store information about which students are enrolled in
which courses.
You must decide on appropriate data types for each column (e.g., VARCHAR, INT,
DATE).
1. Insert sample data into each table. For example, you could add 5-10 students, 3-5
courses, and 10-15 enrollment records. Each entry should reflect realistic data.
2. Make sure to use valid data types for each field and ensure that the relationships (such
as foreign keys) are respected.