Display the rest of the email address starting from 3rd position from left.
Display the last four chars of the email address.
Display ( email address ) starting from 2nd position 4 chars (to be collected)
Display from right ( end ) starting from 6 position return 4 chars (length)
Display the position of @ inside email address along with the email address.
From the email address get the first (left) 3 chars along with the email address.
From the email address get the last (right) 3 chars along with the email address.
In one column email address are stored, create another two columns and store userid in one and domain part in other column of the table. ( use the above concepts )
Using the above update, reverse the userid and display
Along with the original userid, display userid by adding plus2net_ before
Along with the original userid, display userid by adding plus2net_ after
How many records will be returnd for this query SELECT * FROM student,student_football
How many records will be returnd for this query SELECT * FROM student,student_football,student_baseball
How many reocrds will be returned for this query SELECT * FROM student,student_football WHERE id=f_id
How many reocrds will be returned for this query SELECT * FROM student,student_football WHERE id != f_id
Display full details of students who are in NOT selected for football team ( use LEFT JOIN ) Try by not using LEFT Join and see the difference.
SELECT id,name,class,mark,sex,f_id FROM `student`
LEFT JOIN student_football on id=f_id
WHERE f_id IS NULL
Display full details of students who are selected for football team
SELECT id,name,class,mark,sex,f_id FROM `student`
LEFT JOIN student_football on id=f_id
WHERE f_id is not null
Display full details of students who are in baseball team
SELECT id, name, class, mark, sex, b_id
FROM `student`
LEFT JOIN student_baseball ON id = b_id
WHERE b_id IS NOT NULL
Display full details of students who are not there in football or baseball team
SELECT id,name,class,mark,sex,b_id,f_id FROM `student`
LEFT JOIN student_baseball on id=b_id
LEFT JOIN student_football on id=f_id
WHERE b_id is null and f_id is null
Display full details of students who are there in any one team
SELECT id,name,class,mark,sex,b_id,f_id FROM `student`
LEFT JOIN student_baseball on id=b_id
LEFT JOIN student_football on id=f_id
WHERE b_id is not null or f_id is not null