Tech Study

Write a query to display the Full name and Branch ID of all students in branch 300 or 600 in ascending order by branch ID

Introduction

The following exercise will help you to improve your SQLite query skills effectively. I have used DB Browser for sqlite for following exercise.

student_id first_name last_name email mobile_number admission_date admission_fee branch branch_id
1. Mike Brown mike@example.com 875695632 12-06-2013 15000 Computer Science 100
2 Chris Lee chris@example.com 789652369 05-06-2012 18000 Computer Science 100
3 David Jones David@example.com 965412369 01-07-2013 14000 Mechanical Engineering 200
4 Michael Johnson Michael@example.com 845632136 22-08-2014 25000 Mechanical Engineering 200
5 Tom Cruise Tom@example.com 789563245 09-06-2013 15000 Civil Engineering 300
6 Mary Smith mary@example.com 846523698 10-07-2014 23000 Electrical engineering 400
7 James Johnson james@example.com 896523145 11-02-2015 25000 Chemical engineering 600
8 Robert Smith robert@example.com 984562368 25-06-2013 22000 Information technology 500
9 Maria Garcia maria@example.com 895641236 12-08-2012 14500 Civil Engineering 300
10 Brett Lee brett@example.com 756984562 20-06-2013 15000 Chemical engineering 600
11 James Anderson james@example.com 895621455 15-07-2018 35000 Information technology 500
12 Joe Root joe@example.com 985641236 22-08-2017 40000 Chemical engineering 600
SELECT first_name, last_name, branch_id
FROM tbl_student
WHERE branch_id IN (300, 600)
ORDER BY  branch_id  ASC;

Result

Write a query to display the Full name and Branch ID of all students in branch 300 or 600 in ascending order by branch ID
Write a query to display the Full name and Branch ID of all students in branch 300 or 600 in ascending order by branch ID

TaggedWrite a query to display the Full name and Branch ID of all students in branch 300 or 600 in ascending order by branch ID

Python Examples

Introduction: Python Examples are the basic programming concepts of python like python syntax,python data types,,python operators,python if else,python comments etc.. …

Read more

C String Functions

C String Functions perform certain operations, It provides many useful string functions which can come into action. The <string.h> header …

Read more