Notes![what is notes.io? What is notes.io?](/theme/images/whatisnotesio.png)
![]() ![]() Notes - notes.io |
CREATE TABLE student (
id int primary KEY AUTO_INCREMENT,
Sname varchar(20),
Sgender varchar(20) DEFAULT 'Male',
Saddress varchar(30) DEFAULT 'Ktm'
);
CREATE table Grade (
Gid int PRIMARY KEY AUTO_INCREMENT,
Marks int NOT null,
Grade varchar(2) DEFAULT 'A',
stream varchar(20)
);
CREATE TABLE Result (
Gid int,
FOREIGN KEY(Gid) REFERENCES grade(Gid),
Sid int,
FOREIGN KEY(Sid) REFERENCES student(Sid)
);
INSERT into student VALUES
('','Nripesh', 'Male', 'ktm'),
('','Shrada', 'Female', 'ktm'),
('','Rita', 'Female', 'bkt'),
('','Himal', 'Male', 'ltr'),
('','Kiran', 'Male', 'ktm');
Insert into grade VALUES ('',99, 'A', 'BCA'), ('',70, 'B', 'BHM'), ('',60, 'C', 'BSW'), ('',90, 'A', 'BCA'), ('',70, 'B', 'BHM');
Select Sname from student join result on result.Sid=student.Sid JOIN grade on grade.Gid=student.Sid;
SELECT student.Sname, grade.Marks FROM student JOIN result ON result.Sid = student.Sid JOIN grade ON grade.Gid = result.Gid WHERE grade.Marks = ( SELECT MAX(Marks) FROM result ) AND student.Saddress = 'ktm';
Select Sname.student, grade.Marks from student join result on result.Sid=student.Sid JOIN grade on grade.Gid=result.Gid ORDER BY grade.Marks DESC limit 3 ;
SELECT S.Sid, S.Sname, G.Marks FROM Student S JOIN Result R ON S.Sid = R.Sid JOIN Grade G ON R.Gid = G.Gid WHERE G.Marks = ( SELECT DISTINCT Marks FROM Grade ORDER BY Marks DESC LIMIT 1 OFFSET 1 );
SELECT student.Sname, grade.Marks FROM student JOIN result ON result.Sid = student.Sid JOIN grade ON grade.Gid = result.Gid ORDER by Sname
SELECT student.Sname,student.Saddress FROM student JOIN result ON result.Sid = student.Sid JOIN grade ON grade.Gid = result.Gid where grade.Marks='A';
SELECT COUNT(Sname) FROM student JOIN result ON result.Sid = student.Sid JOIN grade ON grade.Gid = result.Gid GROUP BY student.Sgender;
![]() |
Notes is a web-based application for online taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000+ notes created and continuing...
With notes.io;
- * You can take a note from anywhere and any device with internet connection.
- * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
- * You can quickly share your contents without website, blog and e-mail.
- * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
- * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.
Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.
Easy: Notes.io doesn’t require installation. Just write and share note!
Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )
Free: Notes.io works for 14 years and has been free since the day it was started.
You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;
Email: [email protected]
Twitter: http://twitter.com/notesio
Instagram: http://instagram.com/notes.io
Facebook: http://facebook.com/notesio
Regards;
Notes.io Team