A relational table, named Student, is required for holding information about stu
ID: 3577497 • Letter: A
Question
A relational table, named Student, is required for holding information about students. The table includes the following attributes: studId, studName, studAge and studCourse. The schema of the relation is as follows: Student(studId, studName, studAge, studCourse) Choose appropriate data types for the different attributes in the Student table, and write an SQL statement to create the Student table. Provide an SQL statement to change the course that student 'S2024' is following to 'MSc'. Choose an instance of a student and write an SQL statement to insert the details of that student into the Student table. Produce a view that will present only two fields, the studId and the studCourse of the students who are 20.Explanation / Answer
#1
create table student(
studId varchar(20) not null,
studName varchar(100) default null,
studAge int default null,
studCourse varchar(100) default null,
primary key (studId)
);
#2
update student set studCourse='MSc' where studId='S2024';
#3
insert into student(studId, studName, studAge, studCourse)
values('S3026','Jroot',20,'MSc');
#4
create view StudAt20Course
as
select studId, studCourse
FROM student where studAge=20;
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.