Answer to Question #295796 in Databases | SQL | Oracle | MS Access for eranna

Question #295796

1. Use SQL commands to perform following operations: a. Display a list of available databases b. Create the database (choose any appropriate name in the format c. Select your database d. Create a table: i. Create a relation with the name DEPARTMENT ii. It has four attributes namely Dept_id, Dept_name, Building, and Budget iii. Dept_id is an integer, Dept_name is a character string of maximum length 20, Building is a character string of maximum length 15, and Budget is a number with 12 digits in total, 2 of which are after the decimal point iv. The create table command should also specify Dept_name attribute as not null and set a default value for Building to ‘A’ e. Drop the table DEPARTMENT f. Add attribute Phone to DEPARTMENT relation using Alter command g. Drop attribute Budget from a relation DEPARTMENT by using Alter command h. Modify datatype of Dept_id to varchar(25) using Alter command 2. Put all your output screenshots along with SQL commands in a single PDF file and upload in Moodle


1
Expert's answer
2022-02-11T07:44:08-0500

DROP TABLE DEPARTMENT;

--create table

CREATE TABLE DEPARTMENT (

Dept_id int not null,

Dept_name varchar(20) not null,

Building varchar(15) DEFAULT 'A',

Budget decimal(10,2)


);



Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS