0% found this document useful (0 votes)
5 views2 pages

SQL Assignment

The document outlines an SQL assignment involving the creation and manipulation of a STUDENTS table in a Student Management System database. It includes tasks such as creating the table, inserting records, retrieving data with specific conditions, updating records, deleting entries, altering the table structure, and finally dropping the table. Submission requires clear SQL queries and execution results with screenshots.

Uploaded by

Shinchan Nohara
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)
5 views2 pages

SQL Assignment

The document outlines an SQL assignment involving the creation and manipulation of a STUDENTS table in a Student Management System database. It includes tasks such as creating the table, inserting records, retrieving data with specific conditions, updating records, deleting entries, altering the table structure, and finally dropping the table. Submission requires clear SQL queries and execution results with screenshots.

Uploaded by

Shinchan Nohara
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

■ SQL Assignment

Instructions:
1 Write SQL statements for the following tasks.
2 Assume you are working with a Student Management System database.
3 Execute queries step by step and verify results.

Q1. CREATE TABLE


Create a table named STUDENTS with the following structure:
- StudentID (INT, Primary Key)
- Name (VARCHAR(50), NOT NULL)
- Age (INT, NOT NULL)
- Department (VARCHAR(30))
- Marks (INT)

Q2. INSERT Records


Insert at least 5 records into the STUDENTS table. Example:
INSERT INTO STUDENTS (StudentID, Name, Age, Department, Marks)
VALUES (1, 'Rahul Sharma', 20, 'Computer Science', 85);

Q3. SELECT with WHERE Clause


1. Retrieve details of students older than 21 years.
2. Retrieve names of students who scored more than 75 marks in 'Computer Science'.
3. Retrieve student records where Age between 18 and 22.

Q4. UPDATE with WHERE Clause


Update the marks of student 'Rahul Sharma' to 90.

Q5. DELETE with WHERE Clause


Delete the record of student whose StudentID = 3.

Q6. ALTER TABLE


1. Add a new column Email (VARCHAR(50)).
2. Modify the size of column Department to VARCHAR(50).
3. Drop the column Email.

Q7. DROP TABLE


Drop the table STUDENTS permanently.

■ Submission Requirement:
1 Write all SQL queries clearly.
2 Execute them in your SQL environment and attach screenshots of results.

You might also like