Week 3 - Introduction To Structured Query Language
Week 3 - Introduction To Structured Query Language
WEEK 3:
Introduction to
Structured Query Language
OBJECTIVES:
► Introduce to SQL
► Learn the command in creating
databases
► Learn the command in creating tables
► Learn to change table structures
What is SQL?
► A Table is an object
► Database data is stored in Tables
► Each table has a unique name
► Columns have various attributes, such as
column name and data type
► Rows contain records or data for the
columns
7
Introduction to SQL
USE databaseName;
► The output shows that the MariaDB command prompt has changed
from none to the name of the database that has been selected.
► You can now go ahead and create tables within the Demo
database.
Creating Tables
Example:
A constraint is a rule.
Some examples constraints are:
• unique - no two entries will be the same
• not null - no entry can be blank
• **primary key - unique identification of each row**
• primary keys will be very important to you as your
knowledge of databases progresses
Data Types
Showing Table Structure