Wednesday, August 10, 2022

L-10: Computer Science | Class-12 | Database Management | Term-2

so hello children hello everyone welcome to my channel visual coding in the continuation of mysql we have learned about the queries based on the stable empl so in my last video we started from here how to search a null value.

And the order by clause and the very important part pattern matching order by clause help you to arrange the data in sending or descending order whereas the pattern matching help you to retrieve the data as per the required of user right the first query as it.

Indicates that you want to print the name which starts with the letter s or letter a so different kind of the combinations i have explained you for more detail you can go through my previous video it will be.

Clear to you so today not wasting time there is a clause there is a option to choose the values from between up mysql i'm going to open it so this is my sql the black screen i have changed the color today.

So that the visibility should be more clear to you all so the very first command we will open my database so use school this is what the database i have created or very table kanam has select empl so i'll open the table this is a command to open table or to see all the contents of.

A table embl in front of okay actually so we did variety is print the maximum.

Salary from the table um so we have a function here select max.

Okay they give me direct sql mechanically i will write select max or sell from emp so maximum salary.

Sorry minimum spelling mi for maximum salary you have a function max easy okay have a stable thinking the highest.

Salary is this 5000 of clear and if you want minimum salary if you have learned the excel somewhere in the junior classes 7 8 class the min function max function works also there to calculate.

Suppose calculate total salary total salary of say um see the table okay now more clear so we have four managers here one two.

Three and this is the fourth manager total salary so we have a function sum here to calculate total of a column value so how we use it let's see select sum okay.

Some cell from embl where job equals to manage you got it salary three five one two five zero two eight five zero and two four five zero so you.

Will get the same answer okay so sorry foreign and if you have condition then apply the condition with the where clause simple so these things are quite easy to.

Understand it only require to practice so you need to practice along with yeah i think this layout is more convenient for all okay so up till here we have done all these things total salary of managers.

To print all print the detail of all whose salary foreign it means i need select all.

Sorry should not be here it should be here okay so we'll write select on select foreign simple mathematical rule and here is the answer all the records six rows are retrieved.

From the table for all the rows which are displayed here their salary is more than 15. then nothing is going to do had it been a physics lab chemistry like biolab there may be the chances of apparatus to damage.

Only you have to put the less than symbol that's all less than 1500 so we have three employees zinke salary less than 1500 right and.

There's one more condition agar query ajay to print salary between 1500 to 3 000. lower so to print detail of.

All whose who salary between whose salary is between 1500 to 3000 okay so again you can use there are two ways to do this query.

Please select all from empl where cell is greater than equals to 1500 and sell is less than equals to fifteen hundred yadrakana uh not 1500 i'm sorry it's a three.

Thousand okay you think this is how we deal with the range of data you have a range from 1500 to 2500 so you should understand both the ways were sell between 1500 and 25.

So between club between keyword between is a keyword which helps you to retrieve their range of data so either you can use those obviously mathematically they would like to use the greater than less than symbol but.

A snap between bmi pathogen because he may ask the output of query so both the way are correct to solve to calculate suppose main target average function goes amazing.

We will write select av average of self okay it require avg right abg yeah.

Mysql uh actually the s excel also take average function uh but bias will take avg so avg will help you to calculate the average of the numeric data condition say so dear students where the query may be.

Thousands in which condition what kind of queries can we apply what kind of clauses will be required to apply queries am i right yeah so this is these are some basic queries.

Which functions so the topic which i am going to start definitely we will practice the the examples the exercise different exercise based on these chapters so mysql functions it means the ready-made functions are available in mysql.

So start there foreign a day then day of month right day of month.

Then we will learn the name then we will learn monthly foreign and then later on we will learn how we use this function in table so select now they can now function it will.

Return the date current date along with time you got it after that we have a function says date same thing no difference the system.

Also returns the date along with time or we can say this date execute the time at which the function is executed command merit okay yeah.

So if we see the day now and this date says no difference correct one car date carded stands for current date and it returns only date no time may have been.

Zero one and what will be the output day of month it will be same because we have today 25th day of month is my next.

25th day so day or day of month will return the same okay i'm looking at the same as day if you write month name okay if you write month name so january print because.

It prints monthly and extracts here from the date up here in.

See so these functions are very very very very very important in terms of database user key different kinds of demands huh so this is how this function are very very important and help us to.

Uh to extract the information in different problems day of year so if you write select day of year eight and fifteen.

Says the independence day is this day of the year so in 2022 it's 227th day of the year i hope you understand children so i'll not make so long video uh rest i'll continue in my next video but it is very important you have a.

Practice and for any query you can comment me on the comment box so thank you and keep learning keep going thank you


Most Popular