0% found this document useful (0 votes)
266 views3 pages

SQL Queries for Student Management

The document contains SQL queries on database tables for students, faculty, courses, and registrations: 1. It selects student and faculty names for a specific student registration number. 2. It selects student names and father names where address contains "chennai". 3. It selects course codes, titles, faculty codes and names from registration and faculty tables. 4. It selects student registration numbers where faculty cabin contains "MB". 5. It selects course titles from courses table where registration slot does not contain "A1".
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
266 views3 pages

SQL Queries for Student Management

The document contains SQL queries on database tables for students, faculty, courses, and registrations: 1. It selects student and faculty names for a specific student registration number. 2. It selects student names and father names where address contains "chennai". 3. It selects course codes, titles, faculty codes and names from registration and faculty tables. 4. It selects student registration numbers where faculty cabin contains "MB". 5. It selects course titles from courses table where registration slot does not contain "A1".
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 3

cycle sheet 2 DBMS ================================ 12) select s.name,f.name from student s,faculty f,student_proctor p where s.regno=p.regno and p.proctor_code=f.

code and s.regno='10bit0214'; 13) SQL> select s.name,p.fathername from student s,student_personal p where s.re gno=p.regno and p .address like '%chennai%'; 14) SQL> select r.c_code,c.title,r.f_code,f.name from registration r,faculty f,c ours es c where r.c_code=c.code and r.f_code=f.code; 15) SQL> select s.regno from student s,student_proctor sp,faculty f where s.regn o=sp .regno and sp.proctor_code=f.code and f.cabin like '%MB%'; 16) SQL> select c.title from courses c,registration r where c.code=r.c_code and r.sl ot not like '%A1%'; 17) SQL> select regno from student minus select regno from student_personal; 18) SQL> select name from faculty where code not in (select code from faculty mi nus select proctor_code from student_proctor ); 19) SQL> select school from faculty union select school from courses; 20) SQL> select s.name,f.name from student_proctor sp left outer join student s on sp.regno=s.regno right outer join faculty f on sp.proctor_code=f.code; NAME NAME ---------- ---------Rishabh SKssdf Din boss yoge SQL> select * from faculty; CODE --------10SBST122 09SITE134 08SITE212 08SITE333 NAME ---------SKssdf yoge Din boss SCHOO ----SBST SITE SITE SITE CABIN ------MB A13 SJT A12 SJT B34 TT B3

SQL> select * from student; REGNO --------10bit0214 09bit0012 11bbt0001 12BIT0207 NAME ---------Rishabh shivany Devika pawan PROGRAM ------B-TECH B-TECH B_TECH B-TECH BRANC ----IT IT BIO CSE DOB YOA --------- ---------20-SEP-92 2010 04-APR-91 2009 29-AUG-92 2011 22-SEP-92 2012

SQL> select * from student_proctor;

REGNO --------10bit0214 09bit0113 11bit0127 11bit0012 12bit0015 11bit0135

PROCTOR_C --------10SBST122 09SITE132 08SITE213 08SITE213 08SITE422

6 rows selected. 21) SQL> select r.slot,r.venue,c.title from courses c,registration r where r.c_c ode(+)=c.code and r.venue is not null; ..... SQL> select r.slot,r.venue,c.title from courses c full outer join registration r on r.c_code=c.code and r.venue is not null; .... SQL> select r.slot,r.venue,c.title from courses c,registration r where r.c_code (+)=c.code ;///main 22) SQL> select s.name,f.name from student_proctor sp full outer join student s on s p.regno=s.regno full outer join faculty f on sp.proctor_code=f.code; NAME NAME ---------- ---------Rishabh SKssdf shivany pawan Devika

Din boss NAME NAME ---------- ---------yoge 12 rows selected. 23) select school,title from courses group by school,title; //y so simple ??? 24) SQL> select avg((sysdate-dob)/365) from student where yoa=2010; 25) SQL> select sum(credits) from courses where school='SITE' ; 26) // get questn ??? 27) SQL> select school,count(code)from courses group by school; 28) SQL> select venue,count(c_code) from registration group by venue order by ve nue asc; 29) SQL> select f.name from faculty f,registration r where f.code=r.f_code group by

f.name having count(*) >= 2; 30) SQL> select s.name from student s where s.regno in(select r.regno from regis trat ion r,courses c where r.c_code=c.code group by r.regno having sum(credits) < 16) ; NAME ---------Rishabh 31) SQL> select name from faculty where not exists ( select r.f_code from regist rati on r where r.venue like '%SJT%' minus select f.name,f.code from faculty f where f.code=r.f_code); >> select f.name from faculty f where not exists (select r.f_code from registrat ion r where not exists (select f2.code,f2.name from faculty f2 where f2.code=r.f _code and f2.code=f.code));

You might also like