Create a student table and describe the schema of the student table

Create a student table and describe the schema of the student table Create a student table and describe the schema of the student table: Rollno number(6), Name varchar(15),
Dept varchar(10), City varchar(15), DOB date, Gender char(1)

QUERY*
create table student (Rollno number(6), Name varchar(15),
Dept varchar(10), City varchar(15), DOB date, Gender char(1));
Figure 3.1
Fig. 3.1
  • Add foreign key constraint for the column rollno from studmarks that refers rollno from student table.
  • QUERY*
    alter table student add foreign key (Rollno) references stu_marks(Rollno);
    desc student;
    Figure 3.2
    Fig. 3.2
  • Remove the column city from the student table.
  • QUERY*
    alter table student drop column City;
    Figure 3.3
    Fig. 3.3

Comments

Popular posts from this blog

SQL IS NOT NULL.

Database Management System

SQL BETWEEN Operator Example.