Create a table by writing query
Pattern:
CREATE TABLE table_name (
column1 datatype,
column2 datatype,
column3 datatype,
....
);
Query:
CREATE TABLE
… Read more Let's become the Software Development Engineer in Test
Pattern:
CREATE TABLE table_name (
column1 datatype,
column2 datatype,
column3 datatype,
....
);
Query:
CREATE TABLE
… Read more A sub-query is a SQL query that is used inside another query.
There is no specific pattern for sub-query. Sub-query is used when need to query from another or multiple tables and show data.
Suppose, you have to query with … Read more
SQL join clause is used to combine rows from two or multiple tables based on a common columns between them.
There are several types of Join, like:
… Read moreThe GROUP BY statement is used with aggregate functions (COUNT, MAX, MIN, SUM, AVG) to group the result set by one or more columns.
Pattern:
SELECT column_name FROM table_name GROUP BY column_name;
or
SELECT column_name1,column_name2 FROM table_name GROUP BY column_name1,column_name2;
… Read more If you want to sort data, then you have to use order by clause. If you want to sort data in ascending order, then you have to use the following query:
Pattern:
select * from table_name order by column_name ASC;
… Read more In this topic we will learn following queries:
select is used to fetch all data from a table.
Pattern:
SELECT * FROM table;
Example:
SELECT * FROM employees;
… Read more Now we will add some data using the SQL insert query
insert into table_name (column1,column2,column3,……..columnN) values (‘value1′,’value2′,’value3′,……….,’valueN’);
Now insert some data into our newly created table using this query:
INSERT INTO employees (Emp_id,FirstName,LastName,Department,Designation,Salary) VALUES ('1001','Abdur',
… Read more SQL commands are 4 types. DDL, DML, DCL and TCL
Here I am describing about the SQL Commands.
DDL is the short name of Data Definition Language. It used to create, update, and delete database schemas and their … Read more
You can install MySQL on your local PC in two ways. The first way is to install MySQL wizard that make your localhost as MySQL server. The second way is to install Xampp server.
The difference between the 2 ways … Read more