These commands can be classified into group based on their nature
1.Data Definition Language - (DDL)
The commands include
CREATE,ALTER,DROP
2.Data Manipulation Language -(DML)
The commands include
INSERT,UPDATE,DELETE
3.Data Control Language - (DCL)
The commands include
GRANT,GRANT
4.Dta Query Language - (DQL)
The commands include
SELECT
We shall learn these commands through practice,first its important to create a Schema where most of our tables will reside.

Go ahead and set the path to schema.

Create a table with the following syntax.
create the following 2 tables.
INSERT INTO command is used to insert data into tables.When inserting data into a table its important to specify the columns
in chronological order.Make sure the data being inserted is presented in the correct way.Date,texts and phone_numbers should be in single quotes.Integers,decimals and percentages should not be in single quotes.

To confirm if the tables have data run the following commands.

It's evident that we have 3 tables exams_result,students and subjects table.
In the comment section(/* ...*/) of the data definition language
,there is a syntax showing how to write such a query.
Data definition language like alter table can be used to rename
a table,rename a column,change dat type,remove a column and add a column.

I have also outlined the syntax for the where clause in the comment section.The where clause can be used in a filtering context and combining logic.On combining logic we use different operators such as between,and,or,greater than,less than and eaqual to.

Count function can be used in different way.First to count the number of rows in the dataset with the following syntax SELECT COUNT(*) FROM table_name;.Second to count the number of values in a certain column with the following syntax SELECT COUNT(column_name) FROM table_name WHERE condition;

The CASE expression is used to define different results based on specified conditions in an SQL statement.
The CASE expression goes through the conditions and stops at the first match (like an if-then-else statement). So, once a condition is true, it will stop processing and return the result. If no conditions are true, it returns the value in the ELSE clause. If there is no ELSE clause and no conditions are true, it returns NULL.




Top comments (1)
Hello everyone could you help critique my work.