Skip to main content

Create Table in SQL

Create table in SQL: How to create table in SQL

In this post , i'm going to explain that how you can create table in SQL easily:

To create table in SQL, you can use CREATE Table command:

Syntax for Create table:

CREATE TABLE Table_Name( Column _Name1 Datatype, Column_Name2 Datatype.....etc);

In above, to create table, First you need to define the action about what you are going to create so i have define command CREATE TABLE, this command will always be used if you are going to create Table.
Then you need to give Table Name because every table must have their unique name.

Then create column name like First_Name, Lasr_Name, Age whatever you required then every column must have their datatype define so that SQL can identify what type of values will be passed.

Now look at below example:
In this we are going to create a table for employee record like EMP table haveEmp_ID, Emp_Name, Emp_Age, DOJ and Salary.

CREATE TABLE EMP

(Emp_ID INT, 
 Emp_Name Varchar(20),
 Emp_Age INT, 
 Emp_Salary INT);

Result will be :

Emp_ID
Emp_Name
Emp_Age
Emp_Salay


This is the way by which you can create SQL Table. To Insert Value in this table, please refer Insert Values post in next post.




Popular posts from this blog

How to analyze a JMeter summary report?

  A  Jmeter  Test Plan must have listener to showcase the result of performance test execution. Listeners capture the response coming back from Server while Jmeter runs and showcase in the form of – tree, tables, graphs and log files. It also allows you to save the result in a file for future reference. There are many types of listeners Jmeter provides. Some of them are: Summary Report, Aggregate Report, Aggregate Graph, View Results Tree, View Results in Table etc. Here is the detailed understanding of each parameter in Summary report. By referring to the figure: Label : It is the name/URL for the specific HTTP(s) Request. If you have selected “Include group name in label?” option then the name of the Thread Group is applied as the prefix to each label. Samples : This indicates the number of virtual users per request. Average : It is the average time taken by all the samples to execute specific label. In our case, the average time for Label 1 is 942 milliseconds & to...

What is usability testing ?

What is usability testing ? Usability testing is a way to see how system is easily usable by the end users. It basically verifies the interface of website and test whether application is user friendly or not. It identifies how the customer will feel comfortable in using the software. Usability Testing not only test Look and feel it also test in how many steps customer will reach their goals Example: Suppose there is an application in which user wants to generate Attendance Report of Employees on daily basis, and user has to follow below steps: 1) Login to Application. 2) Click on Attendance System 3) Click on Reports and select Employee Attendance Report 4) Various Employee Attendance reports will be displayed of different teams. Select particular report(say: Select Team) 5) Select the parameters which you want to display in report say: • Date • Shift Timings • Employee Id • Name • In/Out Time • Status (Present/Absent/leave) 6) Click on Generate Report 7) Click on Print option In this ...

What is Error, Bug and Defec ?

What is Error, Bug and Defect in software testing ? Error :- When developer compile a program and program compilation is failed due to some syntax problem or not used correct logic, is called an Error.  For example:-  public class  { public static void main( string []args) { s.o.p(" hello") } } Now after running this program, we will get an error because there is syntax issues as we haven't use correct syntax to print output. Bug : Bug is something that is not producing expected output or something is not behaving as expected.  For example- Developer develop a program to add two number and that program is running fine but producing wrong result. public class  { public static void main( string []args) { int a=3; int b=2; int s= ++a+b; System.out.println(" hello"); } } Actual output: 6 Expected outpit: 5 So here system is not producing expected output after adding two number. In simple term, whe...