Assignment 1
Query - How I created a table?
To create a table I used syntax from above image it created a table list with 4
Columns and 1 Row
From the above image create table is a command used to create a table and player
is the name of the table whereas the list of columns i.e. name, age, sex,
date_of_joining, weapon is data.
For data I mentioned which kind of data type is required accordingly.
Assignment 1 1
Query - How to run a statement?
To test whether the table is created or not I had written a select statement with
proper syntax.
Assignment 1 2
Query - How to insert the values?
To insert the values into the table the above given syntax is required.
I mentioned data and inserted values into data types in step by step.
After inserting values I tested the output with select statement and the result is seen
in the above image.
Assignment 1 3
Query - How to add a new column?
To add a new column I had given an “alter statement” where the new column is
added.
After following the syntax I again executed the code by using Select statement.
Assignment 1 4
Query - How to drop a column?
It is same as adding the column. the statement is same “alter table” but the syntax
is different from the add column.
I successfully wrote the syntax and executed the code properly by drooping the
column from the table.
To check the result as usual I executed the “select statement”.
Assignment 1 5
Query - How to delete the data from table?
I executed truncate statement i.e. “truncate table player_1” to remove the entire
data from the table.
After writing the statement I successfully executed the code with select statement
again.
The outcome you can see in the above image.
Assignment 1 6
Query - How to delete the table?
To delete the entire table and it’s data I used drop statement i.e. “drop table
player_1”
By this command the entire table has been deleted from the data.
The screenshot shows the table or view does not exist is the output to the above
command.
Assignment 1 7