You are on page 1of 1

SQL -Structured Query Language

Asks database a certain question based on requirements.

Database: A structured set of data (information) held in computer, specially one


that is accessible in various way.

Create a database using clicks:


Ensure that you are connected to database server using Microsoft SQL Server
Management Studio.

Click on View > Object Explorer


Click on + sign next to Databases
Observe the list of available databases.
Right click on Databases and choose "New Database" option
Type the name of the database (i.e. TestDB) in the Database name box
Click on Ok

To Create a Database using the SQL query, use the following command in Microsoft
SQL Server Management Studion:

Syntax - CREATE DATABASE <DatabaseName>


Example - CREATE DATABASE BlueCrestDB

Activity: Write the SQL query to create a database named as EmployeeDB.


Answer: To create the EmployeeDB you should use the following query.

CREATE DATABASE EmployeeDB

What is Table?

Tables are database objects that contain all the data in a database. In tables,
data is logically organized in a row-and-column format similar to a
spreadsheet. ... A standard user-defined table can have up to 1,024 columns. The
number of rows in the table is limited only by the storage capacity of the server.

How to create tables in database?


In query editor you need to type the table query and execute.

Syntax -

CREATE TABLE <table name>


(
Column1_Name <data type>,
Column2_Name <data type>,
Column3_Name <data type>
.........
.........
)

Example -
CREATE TABLE Employeetbl
(
EmployeeName char (20),
EmployeeAddress varchar(100),
DOB date,
Salary float,
DOJ date
)

You might also like