Professional Documents
Culture Documents
Q1. You are required to create the following tables using SQL CREATE command,
table names along with column description is given below. One of the important
things is to use appropriate data types for each column definition and choosing
primary and foreign keys for the tables.
Step 1:
1. Table Name: MEMBER
I didn’t attach my snap you have to use Insert statement like that,
INSERT INTO TABLE NAME VALUES (‘1st column value’,’2nd column value’, &
so on)
Q2. Differentiate ALTER and UPDATE table commands in SQL. You are required
to write example SQL queries for illustration.
Answer:-
The ALTER Statement:-
The ALTER TABLE statement is used to add, delete,
or modify columns in an existing table.
SQL ALTER TABLE Syntax
3). To change the data type of a column in a table, use the following syntax:
UPDATE table_name
SET column1=value, column2=value2...
WHERE some_column=some_value
Query:-
UPDATE ATTENDENCE
SET Location ='Karachi'
WHERE Location='Islamabad'