GATE Exam  >  GATE Questions  >  Create a view which gives students number and... Start Learning for Free
Create a view which gives students number and name for those who enrolled in class ”Database Design” and whose age is under 25.
  • a)
    Create View StudentDD(snum,sname) 
    Select s.snum , s.sname 
    From Student s,Enrolled e 
    Where s.snum=e.snum 
    And e.cname=’Database Design’ and s.age<25.
  • b)
    Create View 
    Select s.snum , s.sname 
    From Student s,Enrolled e 
    Where s.snum=e.snum 
    And e.cname=’Database Design’ and s.age<25;
  • c)
    Create View StudentDD(snum,sname) AS 
    Select s.snum , s.sname 
    From Student s,Enrolled e 
    Where s.snum=e.snum 
    And e.cname=’Database Design’ and s.age<25;
  • d)
     None of these
Correct answer is option 'C'. Can you explain this answer?
Verified Answer
Create a view which gives students number and name for those who enrol...
Following is the syntax for creating views.
CREATEVIEW view_name AS
SELECT column_name(s)
FROM table_name
WHERE condition
View all questions of this test
Most Upvoted Answer
Create a view which gives students number and name for those who enrol...
To create a view that displays the student number and name for those who enrolled in a class, you will need to have a table that contains information about the students and their enrollment status. Let's assume you have two tables: "Students" and "Enrollment".

The "Students" table should have the following columns:
- student_id (unique identifier for each student)
- student_name (name of the student)

The "Enrollment" table should have the following columns:
- enrollment_id (unique identifier for each enrollment record)
- student_id (foreign key referencing the student_id from the Students table)
- class_id (unique identifier for each class)
- enrollment_status (status of enrollment, e.g., enrolled, dropped, completed)

Now, let's create the view:

```sql
CREATE VIEW Enrolled_Students AS
SELECT Students.student_id, Students.student_name
FROM Students
JOIN Enrollment ON Students.student_id = Enrollment.student_id
WHERE Enrollment.enrollment_status = 'enrolled';
```

This view joins the "Students" table with the "Enrollment" table on the student_id column and selects only those records where the enrollment_status is 'enrolled'. The result will be a view that displays the student number and name for those who are currently enrolled in a class.
Explore Courses for GATE exam

Similar GATE Doubts

Create a view which gives students number and name for those who enrolled in class ”Database Design” and whose age is under 25.a)Create View StudentDD(snum,sname)Select s.snum , s.snameFrom Student s,Enrolled eWhere s.snum=e.snumAnd e.cname=’Database Design’ and s.age<25.b)Create ViewSelect s.snum , s.snameFrom Student s,Enrolled eWhere s.snum=e.snumAnd e.cname=’Database Design’ and s.age<25;c)Create View StudentDD(snum,sname) ASSelect s.snum , s.snameFrom Student s,Enrolled eWhere s.snum=e.snumAnd e.cname=’Database Design’ and s.age<25;d)None of theseCorrect answer is option 'C'. Can you explain this answer?
Question Description
Create a view which gives students number and name for those who enrolled in class ”Database Design” and whose age is under 25.a)Create View StudentDD(snum,sname)Select s.snum , s.snameFrom Student s,Enrolled eWhere s.snum=e.snumAnd e.cname=’Database Design’ and s.age<25.b)Create ViewSelect s.snum , s.snameFrom Student s,Enrolled eWhere s.snum=e.snumAnd e.cname=’Database Design’ and s.age<25;c)Create View StudentDD(snum,sname) ASSelect s.snum , s.snameFrom Student s,Enrolled eWhere s.snum=e.snumAnd e.cname=’Database Design’ and s.age<25;d)None of theseCorrect answer is option 'C'. Can you explain this answer? for GATE 2024 is part of GATE preparation. The Question and answers have been prepared according to the GATE exam syllabus. Information about Create a view which gives students number and name for those who enrolled in class ”Database Design” and whose age is under 25.a)Create View StudentDD(snum,sname)Select s.snum , s.snameFrom Student s,Enrolled eWhere s.snum=e.snumAnd e.cname=’Database Design’ and s.age<25.b)Create ViewSelect s.snum , s.snameFrom Student s,Enrolled eWhere s.snum=e.snumAnd e.cname=’Database Design’ and s.age<25;c)Create View StudentDD(snum,sname) ASSelect s.snum , s.snameFrom Student s,Enrolled eWhere s.snum=e.snumAnd e.cname=’Database Design’ and s.age<25;d)None of theseCorrect answer is option 'C'. Can you explain this answer? covers all topics & solutions for GATE 2024 Exam. Find important definitions, questions, meanings, examples, exercises and tests below for Create a view which gives students number and name for those who enrolled in class ”Database Design” and whose age is under 25.a)Create View StudentDD(snum,sname)Select s.snum , s.snameFrom Student s,Enrolled eWhere s.snum=e.snumAnd e.cname=’Database Design’ and s.age<25.b)Create ViewSelect s.snum , s.snameFrom Student s,Enrolled eWhere s.snum=e.snumAnd e.cname=’Database Design’ and s.age<25;c)Create View StudentDD(snum,sname) ASSelect s.snum , s.snameFrom Student s,Enrolled eWhere s.snum=e.snumAnd e.cname=’Database Design’ and s.age<25;d)None of theseCorrect answer is option 'C'. Can you explain this answer?.
Solutions for Create a view which gives students number and name for those who enrolled in class ”Database Design” and whose age is under 25.a)Create View StudentDD(snum,sname)Select s.snum , s.snameFrom Student s,Enrolled eWhere s.snum=e.snumAnd e.cname=’Database Design’ and s.age<25.b)Create ViewSelect s.snum , s.snameFrom Student s,Enrolled eWhere s.snum=e.snumAnd e.cname=’Database Design’ and s.age<25;c)Create View StudentDD(snum,sname) ASSelect s.snum , s.snameFrom Student s,Enrolled eWhere s.snum=e.snumAnd e.cname=’Database Design’ and s.age<25;d)None of theseCorrect answer is option 'C'. Can you explain this answer? in English & in Hindi are available as part of our courses for GATE. Download more important topics, notes, lectures and mock test series for GATE Exam by signing up for free.
Here you can find the meaning of Create a view which gives students number and name for those who enrolled in class ”Database Design” and whose age is under 25.a)Create View StudentDD(snum,sname)Select s.snum , s.snameFrom Student s,Enrolled eWhere s.snum=e.snumAnd e.cname=’Database Design’ and s.age<25.b)Create ViewSelect s.snum , s.snameFrom Student s,Enrolled eWhere s.snum=e.snumAnd e.cname=’Database Design’ and s.age<25;c)Create View StudentDD(snum,sname) ASSelect s.snum , s.snameFrom Student s,Enrolled eWhere s.snum=e.snumAnd e.cname=’Database Design’ and s.age<25;d)None of theseCorrect answer is option 'C'. Can you explain this answer? defined & explained in the simplest way possible. Besides giving the explanation of Create a view which gives students number and name for those who enrolled in class ”Database Design” and whose age is under 25.a)Create View StudentDD(snum,sname)Select s.snum , s.snameFrom Student s,Enrolled eWhere s.snum=e.snumAnd e.cname=’Database Design’ and s.age<25.b)Create ViewSelect s.snum , s.snameFrom Student s,Enrolled eWhere s.snum=e.snumAnd e.cname=’Database Design’ and s.age<25;c)Create View StudentDD(snum,sname) ASSelect s.snum , s.snameFrom Student s,Enrolled eWhere s.snum=e.snumAnd e.cname=’Database Design’ and s.age<25;d)None of theseCorrect answer is option 'C'. Can you explain this answer?, a detailed solution for Create a view which gives students number and name for those who enrolled in class ”Database Design” and whose age is under 25.a)Create View StudentDD(snum,sname)Select s.snum , s.snameFrom Student s,Enrolled eWhere s.snum=e.snumAnd e.cname=’Database Design’ and s.age<25.b)Create ViewSelect s.snum , s.snameFrom Student s,Enrolled eWhere s.snum=e.snumAnd e.cname=’Database Design’ and s.age<25;c)Create View StudentDD(snum,sname) ASSelect s.snum , s.snameFrom Student s,Enrolled eWhere s.snum=e.snumAnd e.cname=’Database Design’ and s.age<25;d)None of theseCorrect answer is option 'C'. Can you explain this answer? has been provided alongside types of Create a view which gives students number and name for those who enrolled in class ”Database Design” and whose age is under 25.a)Create View StudentDD(snum,sname)Select s.snum , s.snameFrom Student s,Enrolled eWhere s.snum=e.snumAnd e.cname=’Database Design’ and s.age<25.b)Create ViewSelect s.snum , s.snameFrom Student s,Enrolled eWhere s.snum=e.snumAnd e.cname=’Database Design’ and s.age<25;c)Create View StudentDD(snum,sname) ASSelect s.snum , s.snameFrom Student s,Enrolled eWhere s.snum=e.snumAnd e.cname=’Database Design’ and s.age<25;d)None of theseCorrect answer is option 'C'. Can you explain this answer? theory, EduRev gives you an ample number of questions to practice Create a view which gives students number and name for those who enrolled in class ”Database Design” and whose age is under 25.a)Create View StudentDD(snum,sname)Select s.snum , s.snameFrom Student s,Enrolled eWhere s.snum=e.snumAnd e.cname=’Database Design’ and s.age<25.b)Create ViewSelect s.snum , s.snameFrom Student s,Enrolled eWhere s.snum=e.snumAnd e.cname=’Database Design’ and s.age<25;c)Create View StudentDD(snum,sname) ASSelect s.snum , s.snameFrom Student s,Enrolled eWhere s.snum=e.snumAnd e.cname=’Database Design’ and s.age<25;d)None of theseCorrect answer is option 'C'. Can you explain this answer? tests, examples and also practice GATE tests.
Explore Courses for GATE exam
Signup for Free!
Signup to see your scores go up within 7 days! Learn & Practice with 1000+ FREE Notes, Videos & Tests.
10M+ students study on EduRev