Daily Challenge
Programi - 9730
Solved By 745 Users –
skillRack
SQL - SELECT Mobiles
A table called mobile is created with the following DDL command:
CREATE TABLE mobile (id INT, name VARCHAR(30), imei VARCHAR (39)
Write the SQL query to select id, name and imei from the table mobile where the imei number
contains 545 in any position.
Note: The id of the mobiles must be sorted in ascending order
Answers
SQL Query
Create a table called mobile with the field as id number, name of the mobile, and IMEI number. Insert the values for the required field.
These 3 commands are the DDL commands( Data Definition Language).
create a table
insert the values
retrieve the data
The Question contains 3 condition
1) id should be in ascending order
2) IMEI number should have the value 545 number
3) if the value same in IMEI number as repeat, it should order by ascending order.
select * from mobile where IMEI Like '545%' order by id;
Output:
All the field in the table will be displayed as an output. the like command is used to search the sequence number is repeated in the column and the output will give you only the number present field data.
After with that data, the id field will be sorted into as ascending order.
To Learn More....
brainly.in/question/15105742