Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write an SQL query to create 2 tables DEPT, EMP with the given details DEPT Columns Datatype Size D_ID Varchar2 3 D_Name Varchar2 10 EMP
Write an SQL query to create 2 tables DEPT, EMP with the given details DEPT Columns Datatype Size D_ID Varchar2 3 D_Name Varchar2 10 EMP Columns Datatype Size Constraints E_ID Number 3 Primary Key E_Name Varchar2 15 D_ID Varchar2 3 Foreign key Write an SQL query to add 3 records in to the table EMP. E ID E_Name D_ID 222 Ahmed D10 Safa D20 333 Rafa D30 EMP Columns Datatype Size Constraints E_ID Number 3 Primary Key E_Name Varchar2 15 D_ID Varchar2 3 Foreign key Salary Number 8,2 a. Write a SQL query to add constraint CHECK to check Salary >0 with a suitable constraint name (1.5 Marks) b Write an SQL Query to remove the table from the database. (1Mark) EID 222 333 444 555 E Name Ahmed Safa Ahmed Safa EMP DID D10 D20 D30 D10 Salary 200.65 300.50 400.00 Write an SQL query to change employee name Ahmed" as "Mohamed" whose department ID is D10
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