0% found this document useful (0 votes)
8 views16 pages

11.databases 11.6 Guide Do Practice Set (Database)

The document provides a comprehensive guide on databases, covering topics such as database architecture, models, and design. It includes a practical set of instructions for installing and using SQL Server Management Studio, creating databases and tables, and performing operations like insert, delete, update, select, join, and union. The guide emphasizes the importance of structuring tables and defining primary keys for effective database management.

Uploaded by

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

11.databases 11.6 Guide Do Practice Set (Database)

The document provides a comprehensive guide on databases, covering topics such as database architecture, models, and design. It includes a practical set of instructions for installing and using SQL Server Management Studio, creating databases and tables, and performing operations like insert, delete, update, select, join, and union. The guide emphasizes the importance of structuring tables and defining primary keys for effective database management.

Uploaded by

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

11.

DATABASES

Subtitle
Content

 11.1 Introduction
 11.2 Database architecture
 11.3 Database model
 11.4 The relationship database model
 11.5 Database design
 11.6 Guide do practice set (database)
6- GUIDE DO PRACTICE SET
(DATABASE IN MS SQL)
1. Install the SQL Server


Install the SQL Server Management Studio software. This software is available for
free from Microsoft, and allows you to connect to and manage your SQL server from a
graphical interface instead of having to use the command line
2. Start up SQL Server Management Studio

 Start up SQL Server


Management Studio. When you
first start the program, you will be
asked what server you would like
to connect to.
 If you already have a server up
and running, and have the
permissions necessary to connect
to it, you can enter the server
address and authentication
information.
 If you want to create a local
database, set the Database Name
to … and the authentication type
to "Windows Authentication".
3. Locate the Database folder

 Locate the Database folder. After


the connection to the server, either
local or remote, is made, the Object
Explorer window will open on the
left side of the screen.
 At the top of the Object Explorer
tree will be the server you are
connected to. if it is not expanded,
click the "+" icon next to it. Located
the Databases folder.[
4. Create a new database

 Create a new database. Right-click on


the Databases folder and select "New
Database...".
 A window will appear, allowing you to
configure the database before creating
it. Give the database a name that will
help you identify it.
 Most users can leave the rest of the
settings at their default.
5. Create a table

 Create a table. A database can only


store data if you create a structure
for that data.
 A table holds the information that
you enter into your database, and
you will need to create it before you
can proceed.
 Expand the new database in your
Database folder, and right-click on
the Tables folder and select "New
Table...".
6. Create the Primary Key

 Create the Primary Key. It is


highly recommended that you
create a Primary Key as the first
column on your table. This acts as
an ID number, or record number,
that will allow you to easily recall
these entries later.
 To create this, enter "ID" in the
Column Name field, type int into the
Data Type field, and uncheck the
"Allow Nulls." Click the Key icon in
the toolbar to set this column as the
Primary Key.
7. Understand how tables are structured

 Understand how tables are


structured. Tables are composed of
fields or columns. Each column
represents one aspect of a database
entry.
 For example, if you were creating a
database of employees, you might have
a "FirstName" column, a "LastName"
column, an "Address" column, and a
"PhoneNumber" column.
3. Insert

 The insert operation is a unary operation—that is, it is applied to a single relation. The
operation inserts a new tuple into the relation. The insert operation uses the following format:

Figure 11.9 An example of a Insert sentence


4. Delete

 The delete operation is also a unary operation. The operation deletes a tuple defined by a
criterion from the relation. The delete operation uses the following format:

Figure 11.10 An example of a Delete sentence


5. Update

 The update operation is also a unary operation that is applied to a single relation. The
operation changes the value of some attributes of a tuple. The update operation uses the
following format:

Figure 11.11 An example of a Update sentence


6. Select

 The select operation is a unary operation. The tuples (rows) in the resulting relation are a
subset of the tuples in the original relation.

Figure 11.12 An example of a Select sentence


7. Join

 The join operation is a binary operation that combines two relations on common attributes.

Figure 11.13 An example of a Join sentence


8. Union

 The union operation takes two relations with the same set of attributes.

Figure 11.14 An example of a Union sentence

You might also like