Basic SQL Commands
SQL is a language to operate databases; it includes database creation, deletion, fetching rows, modifying rows, etc
What is SQL?
SQL is Structured Query Language, which is a computer language for storing, manipulating and retrieving data stored in a relational database.
QUERY : -
1.How to create Database : A Database is defined as a structured set of data. So, in SQL the very first step to store the data in a well structured manner is to create a database. The CREATE DATABASE statement is used to create a new database in SQL.
___ we want create student name database
2. How to check your database create or not / show databases
4. How to create a table in Database : CREATE TABLE creates a new table in the database. It allows you to specify the name of the table and the name of each column in the table.
Most used Database by Developers in 2021Click here
8. How to data insert in table : The INSERT INTO statement is used to insert new records in a table.
10. if We want delete row in table : DELETE statements are used to remove rows from a table.
13. find record by id
15. Use alias : AS is a keyword in SQL that allows you to rename a column or table using an alias.
16. Select record without duplicate field in table : SELECT DISTINCT specifies that the statement is going to be a query that returns unique values in the specified column(s).
17. find two or more value in table : The BETWEEN operator is used to filter the result set within a certain range. The values can be numbers, text or dates.
18. Use OR Syntax : OR is an operator that filters the result set to only include rows where either condition is true.
23. How to add total column : SUM() is a function that takes the name of a column as an argument and returns the sum of all the values in that column.
24. Find min id from table : MIN() is a function that takes the name of a column as an argument and returns the smallest value in that column.
25. Find max id from table : MAX() is a function that takes the name of a column as an argument and returns the largest value in that column.
26. How to find the employee whose salary is minimum.
27. How to find the employee whose salary is highest
28. How to insert data in blank column : UPDATE statements allow you to edit rows in a table.
29. Use Inner JOIN : An inner join will combine rows from different tables if the join condition is true.
30. Use LEFT JOIN : An outer join will combine rows from different tables even if the join condition is not met. Every row in the left table is returned in the result set, and if the join condition is not met, then NULL values are used to fill in the columns from the right table.
Post a Comment