Using only DOS-based Oracle SQL and answer for the following questions. Again, y
ID: 3798161 • Letter: U
Question
Using only DOS-based Oracle SQL and answer for the following questions. Again, you MUST use DOS-based SQL. NOT accept other SQL programs. For each question, copy each screen shot of the DOS-based SQL code run/output screens, and paste them into your Assignment.
For example: DOS-Based SQL
1. Create a table (table name must be your first name (first letter)+last_name, (e.g., Kwang Lee => KLEE). The table must include following columns (fields): (10 points)
-. CWID
-. Name
-. Date of Birth
-. Address
-. Etc
2. Insert columns (School, Department) into the table and delete a column (Etc) from the table. Then copy the screen shot of SQL code and an output screen, and paste into the Assignment (10 points).
3. Insert at least three virtual data (you and your two friend data) into the table and list the students’ name, CWIID, and Address who are Computer Science Department. Then copy the screen shot of SQL code and an output screen, and paste into the Assignment (10 points).
4. Create another table (table name DEPT). The table must include following columns (fields):
-. CWID
-. Name
-. Class name
-. Grade
Insert at least three virtual data (you and your two friend data) into the table and display the form using “Views” command. Then copy the screen shot of SQl code and an output screen, and paste into the Assignment (10 points).
5. Containing two tables relation, then identify a primary key and a candidate key. List the students’ name, class name, grade, and address where the students’ age is over 5 years using the relational commands (10 points).
Explanation / Answer
1.CREATE A TABLE:-
CREATE TABLE KLEE
(
CWID int,
Name varchar(255),
DateofBirth Date,
Address varchar(255),
Etc varchar(255)
);
2.INSERT COLUMNS INTO THE TABLE:-
ALTER TABLE KLEE
ADD School varchar;
ALTER TABLE KLEE
ADD Department varchar;
DELETE COLUMN FROM THE TABLE:-
ALTER TABLE KLEE
DROP COLUMN Etc;
3.INSERT THE DATA INTO THE TABLE:-
INSERT INTO KLEE(CWID,Name,DateofBirth,Address,School,Department)
VALUES(101,AAA,2017-01-15Gandhinagarr,ABC,CSE);
INSERT INTO KLEE(CWID,Name,DateofBirth,Address,School,Department)
VALUES(102,BBB,2017-01-16,GandhiNagar,PQR,CSE);
INSERT INTO KLEE(CWID,Name,DateofBirth,Address,School,Department)
VALUES(103,CCC,2017-01-17,GandhiNagar,XYZ,EEE);
DISPLAY THE STUDENT'S DATA USING WHERE CONDITION:-
SELECT Name,CWID,Address WHERE Department='CSE';
4.CREATE A TABLE:-
CREATE TABLE DEPT
(
CWID int,
Name varchar(10),
ClassName varchar(15),
Grade varchar(20)
);
INSERT THE DATA INTO THE TABLE:-
INSERT INTO DEP(CWID,Name,ClassName,Grade) VALUES(101,AAA,A1,A);
INSERT INTO DEP(CWID,Name,ClassName,Grade) VALUES(102,BBB,A1,B);
INSERT INTO DEP(CWID,Name,ClassName,Grade) VALUES(103,CCC,A1,C);
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.