21BCE10157 Lab 4

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 2

Date: 24/11/23 Title

Exp. No: 04 SQL

Name: Umar Iqbal

Reg. No: 21BCE10720

AIM OF THE EXPERIMENT:

1. Selects the "FName" and "City" columns from the student.


2. Selects the students name whose belongs to Indore city.
3. Selects the students name those belongs to Indore city and CSE branch.
4. Select the student details whose branch is CSE.
5. Select the student details whose belongs to Indore or Bhopal.
6. selects all (including the duplicates) values from the "City" column in the "Student"
table:
7. selects only the DISTINCT values from the "City" column in the "Student" table:
8. Update the new phone number of “John”.
9. updates the student details (Sid = 103) with a new phone number and a new city.
10. update the Subject to "DBMS" for all records where branch is "CSE”.
11. deletes the student "Harry" from the "Student" table.
12. selects all student with a Sid between 100 and 200.

CODE:
1: SELECT FName, City FROM Student;
2: SELECT FName FROM Student WHERE City = 'Indore';
3: SELECT FName FROM Student WHERE City = 'Indore' AND Branch = 'CSE';
4: SELECT * FROM Student WHERE Branch = 'CSE';
5: SELECT * FROM Student WHERE City IN ('Indore', 'Bhopal');
6: SELECT City FROM Student;
7: SELECT DISTINCT City FROM Student;
8: UPDATE Student SET PhoneNumber = 'new_number' WHERE FName = 'John';
9: UPDATE Student SET PhoneNumber = 'new_number', City = 'new_city' WHERE Sid =
103;
10: UPDATE Student SET Subject = 'DBMS' WHERE Branch = 'CSE';
11: DELETE FROM Student WHERE FName = 'Harry';
12: SELECT * FROM Student WHERE Sid BETWEEN 20 AND 100;

You might also like