II. Database Management System Core Concepts
II. Database Management System Core Concepts
Database
Management
System: Core
Concepts
What is SQL?
SQL (Structured Query Language) is a domain specific language used in programming and
designed for managing data held in a relational database management system.
SQL itself is not a programming language, but its standard allows creating procedural
extensions for it, which extends it to the functionality of a mature programming language.
A query is a request for data or information from a database table or combination of
tablets.
What is
MySQL?
MySQL is a fast, easy to use relational
database. It is currently the most popular
opensource database. It is very commonly
used in conjunction with PHP scripts to
create powerful and dynamic server-side
applications.
After downloading the setup file, we will open the setup file
and click the install button in order to begin the installation. On
this screen, the Location setting specifies the installation path
of the Microsoft SQL Server Management Studio:
Installation
We can download the latest version of the SSMS from the
Microsoft download website and we can also find out the
release notes.
After downloading the setup file, we will open the setup file
and click the install button in order to begin the installation. On
this screen, the Location setting specifies the installation path
of the Microsoft SQL Server Management Studio:
Installation
\
Now, we can launch SSMS from the Start menu:
Also, we can use the Command Prompt to launch SSMS:
Planning and Creating
Database
Launching SSMS and Connecting to a Server
To begin, launch SQL Server Management Studio
and connect to your SQL Server instance. You’ll be
prompted to enter the server name, authentication
method, and credentials. Once connected, you’ll
see the Object Explorer, which is your gateway to
managing databases and their objects.
Planning Your Database
Table
Before you start creating a table, it’s crucial to
plan its structure. This involves deciding on the
table’s name, the columns it will contain, and the
data types for each column. Consider the
following aspects:
Planning Your Database
Table
• Table Name: Choose a name that clearly represents the data
within the table.
• Columns: Determine what information you need to store and
create columns accordingly.
• Data Types: Assign the appropriate data type to each column,
such as INT for integers, VARCHAR for variable-length
strings, or DATE for dates.
• Primary Key: Decide on a column (or a set of columns) that
will uniquely identify each row in the table.
Creating a New Database
Table in SSMS
With your table planned, it’s time to create it within
SSMS. Follow these steps to create a new database
table:
Step 1: Navigate to the
Database
In the Object Explorer, expand the ‘Databases’ folder
and locate the database where you want to create your
new table. If you don’t have an existing database, you’ll
need to create one by right-clicking on the ‘Databases’
folder and selecting ‘New Database’.
Step 2: Initiate Table
Creation
Once you’ve selected your database, right-click on the
‘Tables’ folder and choose ‘New Table’. This will open a
new table design window where you can define the
structure of your table.
Step 3: Define Table
Columns and Data Types
In the table design window, you’ll see a grid where you
can define your columns. Enter the column names and
select the appropriate data types from the dropdown
menu. You can also specify whether a column allows
NULL values by checking or unchecking the ‘Allow
Nulls’ checkbox.
Step 4: Set the Primary
Key
To set a primary key, select the column(s) that will serve
as the key, right-click, and choose ‘Set Primary Key’. A
primary key ensures that each row in the table is unique
and not null.
Step 5: Save the Table
After defining your table’s structure, click the ‘Save’
button or press Ctrl+S to save your table. You’ll be
prompted to name your table. Enter a descriptive name
and click ‘OK’ to create the table