Write statements in SQL data definition language (Create, etc.) and data manipul
ID: 3829755 • Letter: W
Question
Write statements in SQL data definition language (Create, etc.) and data manipulation language (select, etc.) in order to manage relational database schemas and instances. Question 1 a) Create table named Doctor with the following fields: Data Type NUMBER 4) First name VARCHAR200) last name address VARCHAR 2030) Not null VARCHAR2 (50) Unique Answer: b) Create table named Department with the following fields: Data Type Fed Name NUMBER(2) dept id dept name VARCHAR2(30) phone number 10) NUMBER(40 Foreign key Answer:Explanation / Answer
Here is the code for Question 1:
DROP TABLE Doctor;
CREATE TABLE Doctor(
Doc_id NUMBER(4) PRIMARY KEY,
First_name VARCHAR2(30) NOT NULL,
Last_name VARCHAR2(30) NOT NULL,
Address VARCHAR2(30) NOT NULL,
Email VARCHAR2(50) UNIQUE);
DROP TABLE Department;
CREATE TABLE Department(
Dept_id NUMBER(2) PRIMARY KEY,
Dept_name VARCHAR2(30) NOT NULL,
phone NUMBER(10) NOT NULL,
Doc_id NUMBER(4) REFERENCES Doctor);
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.