SQL Tutorial 4: Database Fundamentals

SQL Tutorial 4: Database Fundamentals and SQL Language Elements

i) Database Fundamentals

ii) SQL Language Elements
i) Database Fundamentals

• Database Server instance contains multiple databases
• Database contains multiple Tables
• Table contains multiple records (rows and columns)

What is a Database?

• A Database is a systematic collection of data.
• Databases support storage and manipulation of data
• Databases make data management easy.

Table and Record

• A Table in a Relational Database is a predefined format of rows and columns that define an entity.
• Each column contains a differnt type of attribute and each ror coresponds to a single record
• Each Table is provided with a name.

Example: Table name: Students

SID Name Address ContactNo
10001 abcd errtt,ttt 9878787878
10002 xyz fwew,er 8786767676

What is DBMS?

• A Database management System is software designed to assist in maintaining and utilizing large collection of data.

• The alternative to use a DBMS is to store the data in files and write application specific code to manage it.

Using a DBMS to manage data has many advantages:

• Data Independence
• Efficient Data Access
• Data Integrity and security
• Data Administration
• Concurrent Access and Data Recovery

Database Fundamentals for Beginners

Types of Database Management System

1) Hierarchical DBMS
2) Network DBMS
3) Relational Database Management System (RDBMS)
Ex: Oracle, MS SQL Server, MySQL, DB2 etc…
ii) SQL Language Elements

1) Identifiers:
Names of Database Objects such as Tables, Views, Columns etc…

2) Data Types:
Define the type of data that is contained by a Column

3) Constants:
Symbols that represent specific data types

4) Operators:
Perform Arithmetic, Comparison, and Logical Operations

5) Functions: Built-in Functions to perform specific operations

6) Clauses:
Constituent components of statements and queries.

7) Expressions:
Produce scalar values, or tables containing of columns and rows of data.

8) Queries:
Retrieve the data based on specific criteria, this an important element of SQL.

9) Statements Etc…
Create – It is a Command

Create Database gcreddyabc – It is a Statement


Create Database gcreddyabc – It create a Database called gcreddyabc in Oracle RDBMS

MS SQL Server

Create Database gcreddyabc – It create a Database called gcreddyabc in MS SQL Server RDBMS
Use / Practice SQL

SQL is used to communicate with databases, it is the Standard Language for
Relational Database management Systems.

Database Engine is required to use/practice SQL Commands/Queries, we can use any
Database Engine either Oracle, MySQL or MS SQL Server etc…

MS SQL Server:
MS SQL Server is a Commercial Software but Microsoft providing Free Edition also.

Microsoft SQL Server Express Edition

Download and Install MS SQL Server Express Edition
(Windows 7 – MS SQL Server 2014 Express Edition,
Windows 10 – 2014 or 2016 Express Edition)

After In Editor,
Write SQL statements and Execute.
SQL Step by Step Tutorials

SQL Tutorial 1: Introduction to SQL

SQL Tutorial 2: SQL Overview

SQL Tutorial 3: SQL Environment Setup

SQL Tutorial 4: Database Fundamentals and SQL Language Elements

SQL Tutorial 5: Data Definition Language

SQL Tutorial 6: Data Manipulation Language

SQL Tutorial 7: SQL Operators

SQL Tutorial 8: The Select Query

SQL Tutorial 9: SQL Joins

SQL Tutorial 10: SQL Functions

SQL Tutorial 11: SQL Comments

SQL Tutorial 12: SQL Date Functions

Top 10 Database Management Systems

SQL vs. NoSQL Databases

SQL Interview Questions and Answers

Follow me on social media: