Vous êtes sur la page 1sur 2

DATABASE MANAGEMENT SYSTEM

PRACTICAL LAB ASSIGNMENT 4 (Based on Different integrity constraints)

1. Create the following 2 tables STUDENT and RESULT with the following structure:
STUDENT RESULT

Name Type and constraint Description


ROLLNO INT Primary key Roll no of a student
SNAME VARCHAR(20) NOT Employee name
NULL
SHIFT CHAR(1) Should be Morning/Evening
only either M or E Shift
MOBILE NUMERIC(4) default Mobile no
value is 4444
FEES INT Should be College fee
greater than =3000
& less than= 5000
Name Type and constraint Description
ROLLNO INT Foreign key Roll no of a
references STUDENT student
MATHS NUMERIC(2) MATHS MARKS
POM NUMERIC(2) POM
DE NUMERIC(2) DE
DS NUMERIC(2) DS
DBMS NUMERIC(2) DBMS

2. Insert the following records into STUDENT Table. Check the record for the last 3 entries, find
out the errors & then insert the appropriate data.
ROLLNO SNAME SHIFT MOBILE FEE
1 VINAY M 7902 4000
2 RIMA E 7698 3050
3 MINI E 7698 4500
2 AVI M 2345 4200
5 YUG Y 3456 4500
1
6 HARI M 5432 2000
3. Insert the following records into RESULT Table. Find error for the last record entry.
ROLLNO MATHS POM DE DS DBMS
1 56 65 53 55 59
2 72 69 74 77 76
7 83 78 86 88 55
4. Perform the following queries :

i) Describe the structure of the table STUDENT and RESULT.


ii) Select all the records from STUDENT.
iii) Select all the records from RESULT.
iv) Update shift and fee of RIMA to M and 4000.
v) Add one more column/field named ADDRESS with varchar(20) to STUDENT.
vi) Insert one more appropriate record to STUDENT.
vii) Add result of student MINI assuming your own data.
viii) Display the result of all students along with their rollno, name and shift.
ix) Remove the result of student RIMA.
x) Show those students name in alphabetical order with their result who scored better marks in DBMS than DS.
xi) List the names of all those students who have lowest marks in DBMS.
xii) Shows the result of VINAY in all the subjects.
xiii) List the names of all those students whose MATHS mark is above the average of MATHS marks.

Vous aimerez peut-être aussi