Question
Implementation of Statements (Non-Persistent) Implement the following Statements the tables only need to exist during execution. create table TABLE_NAME ( COLUMN_NAME TYPE, COLUMN_NAME TYPE, COLUMN_NAME
Implementation of Statements (Non-Persistent)
Implement the following Statements the tables only need to exist during execution.
create table TABLE_NAME (
COLUMN_NAME TYPE,
COLUMN_NAME TYPE,
COLUMN_NAME TYPE,
....
);
TABLE_NAME is the name of the table being created. Make sure that a table with that name doesnt already exist.
COLUMN_NAME is the name of the column being created. Make sure that there are no two columns in a single table of the same name.
TYPE is the type of the data stored in the field of the table. The valid types are: integer, float, boolean, char, char(n) where n is an integer (fixed length string).
drop table TABLE_NAME;
Deletes the table and data for the table that matches the TABLE_NAME.
alter table TABLE_NAME add COLUMN_NAME TYPE;
NOTE: If the table already has data the added column will be set to NULL
alter table TABLE_NAME drop COLUMN_NAME;
Removes the Column from the table and its data (if any exist).
alter table TABLE_NAME alter COLUMN_NAME TYPE;
Changes the type of the specified column. CANNOT be performed on a table with data.
insert into TABLE_NAME (COLUMN_NAME_LIST) values (VALUES_LIST);
NOTE: COLUMN_NAME_LIST length must match VALUES_LIST length
update TABLE_NAME set COLUMN_UPDATE_LIST where BOOLEAN_EXPRESSION;
Where clause is optional. If where clause isnt added each record is updated.
NOTE: COLUMN_UPDATE_LIST is the following:
COLUMN_NAME = VALUE, COLUMN_NAME = VALUE, ...
delete from TABLE_NAME where BOOLEAN_EXPRESSION;
where BOOLEAN_EXPRESSION is optional. Deletes any record in the table that causes the BOOLEAN_EXPRESSION to be true. If the where clause isnt added delete each record.
select distinct COLUMN_NAME, COLUMN_NAME, from TABLE_EXPRESSION;
select COLUMN_NAME_LIST from TABLE_EXPRESSION;
NOTE: COLUMN_NAME_LIST can be the following:
COLUMN_NAME, COLUMN_NAME,
* denotes ALL columns. EX. select * from Student;
NOTE: TABLE_EXPRESSION can be the following:
TABLE_NAME
A nested SELECT_STATEMENT in parenthesis.
TABLE_EXPRESSION natural join TABLE_EXPRESSION
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started