Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How can I list all the information in the SQL Query

Can I ask how can I list the department, course, and section for all 4-credit courses offered by the CIS department.

SELECT * FROM classes WHERE credit LIKE ‘4’ AND LIKE ‘CIS’;

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

This statement means it has to meet both conditions the 4% and CIS%

SELECT * FROM classes WHERE credit LIKE '4%' AND LIKE 'CIS%'

This statement means it has to meet either condition the 4% or CIS%

SELECT * FROM classes WHERE credit LIKE '4%' OR LIKE 'CIS%'

the like conditions require a % to match what its suppose to be like, the % after the 4 and CIS means that it should look for anything that starts with 4 or CIS

%4% || %CIS% the percentage on each end in this case would mean that what your looking for contains 4 or CIS

C%IS and this means that its would start with a C and end with IS.

Hope this helps a bit.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading