Session10 LogicalOperators
Session10 LogicalOperators
Session10 LogicalOperators
========================
All students from bangalore who joined through linked in and having less than 8
years of exp;
select course_id,course_name,course_fee,
CASE
WHEN course_duration_in_months > 4 THEN 'masters'
ELSE 'diploma'
END as course_type from courses;
select course_id,course_name,course_fee,
-> CASE
-> WHEN course_duration_in_months > 4 THEN 'masters'
-> ELSE 'diploma'
-> END as course_type from courses;
+-----------+----------------+------------+-------------+
| course_id | course_name | course_fee | course_type |
+-----------+----------------+------------+-------------+
| 1 | bigdata | 40000 | masters |
| 2 | webdevelopment | 20000 | diploma |
| 3 | datascience | 50000 | masters |
| 4 | devops | 10000 | diploma |
| 5 | database | 3000 | diploma |
+-----------+----------------+------------+-------------+
People working for walmart , flipkar and microsoft we want to say product based
else sevrice based
select student_id,student_fname,student_lname,student_company,
CASE
WHEN student_company in ('flipkart','walmart','microsoft') THEN 'product based'
ELSE 'service based'
END as company_type from students;