KnowledgeBoat Logo
|

Informatics Practices

Kabir has created the following table named exam :

RegNoNameSubjectMarks
1SanyaComputer Science198
2SanchayIP100
3VineshCS90
4SnehaIP99
5AkshitaIP100

Help him in writing SQL queries to perform the following tasks :

(i) Insert a new record in the table having following values : [6, 'Khushi', 'CS', 85]

(ii) To change the value "IP" to "Informatics Practices" in Subject column.

(iii) To remove the records of those students whose marks are less than 30.

(iv) To add a new column Grade of suitable datatype.

(v) To display records of "Informatics Practices" subject.

SQL Queries

20 Likes

Answer

(i)

INSERT INTO exam(RegNo, Name, Subject, Marks)
VALUES(6, 'Khushi', 'CS', 85);

(ii)

UPDATE exam 
SET Subject = 'Informatics Practices' 
WHERE Subject = 'IP';

(iii)

DELETE FROM EXAM
WHERE MARKS < 30 ;

(iv)

ALTER TABLE EXAM
ADD COLUMN (Grade VARCHAR(1));

(v)

SELECT * FROM EXAM
WHERE Subject = "Informatics Practices";

Answered By

11 Likes


Related Questions