0% found this document useful (0 votes)
74 views

DB Lab 1

The document summarizes steps taken in a database lab assignment to: 1. Create a database called "Safwan" using both query and graphical methods in SQL Server. 2. Create a table called "data" with columns ID, Name, and Age using both query and graphical table creation methods. 3. Explains how to create tables graphically by opening a database, right clicking on Tables, and specifying column names and data types.

Uploaded by

Syed Safwan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
74 views

DB Lab 1

The document summarizes steps taken in a database lab assignment to: 1. Create a database called "Safwan" using both query and graphical methods in SQL Server. 2. Create a table called "data" with columns ID, Name, and Age using both query and graphical table creation methods. 3. Explains how to create tables graphically by opening a database, right clicking on Tables, and specifying column names and data types.

Uploaded by

Syed Safwan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

COMSATS UNVERSITY ISLAMABAD, ATTOCK

CAMPUS

DATABASE
Lab-Assignment # 1

Submitted To:
Dr. Waseem
Submitted By:
Syed Safwan Abbas Naqvi
(FA18-BCS-055)
Date of Submission:
18-02-2020

Department of Computer Sciences


Following task were done in Lab which include creating database and table:

 Creating Database using Query Method:


To create a new query, click on New Query from standard toolbar of SQL Studio as
shown in figure,

Then type keyword “Create


Database” and then type name of
database as shown in figure.

As I typed Create Database Safwan,


then press execute button from SQL
Editor Toolbar.

A new database is created with a name Safwan as


Figure 1
shown in figure 2:

Figure 2

 Creating Database using Graphical Method:


To create database using graphical method, right
click on Databases from Object Explorer and select
“New Database…” Option from dialog box as
shown in figure 3.

A new Dialog box will open where in field of


“Database name” enter name of database like I typed
Safwan then click Ok button as shown in figure 4.

Figure 3
Figure 4
Now you can see we have created database of name Safwan successfully.

 Creating Table using Query Method:


In order to create any table using query method, click
on New Query from standard toolbar and type
following keywords as shown in figure to create table.

I. use Safwan (means that use this database) and go


II. create table tableName ( ) {These keywords are
used to create new table in given database and all
columns or attributes are written as shown in
figure: Attribute-Name Datatype}
When above keywords are executed a table is created with
column of ID (Integer Type), Name (Character of Limit 50)
and Age (Integer Type).

Table is Created with Name


data
Attributes of Table:
ID, Name, Age
 Creating Table using Graphical Method:
In order to create table graphically, Open database of your choice and then from expand
options, right click of Tables and select “Table…” from dialog box.
A new dialog box will open where you type attributes for table and their datatypes and save
that table as shown in figure.

Now you can see that a new table is created, as shown in figure:

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy